New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os/bluestore:Fix size calculation in bitallocator #10377
Conversation
Passed all three tests:
[==========] Running 8 tests from 1 test case. .... [==========] Running 6 tests from 2 test cases. ..... [----------] 1 test from BitAllocator2 [----------] Global test environment tear-down 2016-07-20 23:25:35.969472 7ffff7fd4680 -1 WARNING: the following dangerous and experimental features are enabled: * ...... [----------] Global test environment tear-down |
3b7d3ca
to
9b1e333
Compare
@markhpc , this is fix for unit test case failure for allocator. |
looks good to me:-) |
One more question:
How does this fix also address this? |
@@ -529,7 +529,7 @@ class BitAllocator:public BitMapAreaIN{ | |||
void free_blocks_dis(int64_t num_blocks, ExtentList *block_list); | |||
bool is_allocated_dis(ExtentList *blocks, int64_t num_blocks); | |||
|
|||
int64_t size() { | |||
int64_t total_blocks() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be a const
method.
now since we have separate function for get_free in BitMapAllocator, caller of get_free will not get m_extra_blocks. Rest internal function will consider m_extra_blocks. allocator::get_free is used by bluestore stats. |
Got it. Thanks for the explanation. |
std::vector<AllocExtent> extents = std::vector<AllocExtent> | ||
(alloc->size(), AllocExtent(-1, -1)); | ||
int64_t blk_size = 1024; | ||
std::vector<AllocExtent> extents = std::vector<AllocExtent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use auto
here.
9b1e333
to
95ef59b
Compare
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
95ef59b
to
0be5d5f
Compare
@tchaikov , addressed all comments and tested again. |
This definitely should have been two commits. @chhabaramesh, please try to limit commits to one issue and make them smaller. @tchaikov, please try to request that in review. |
@dmick sure, will do suggested for future pull requests. |
@dmick sure, will do. thanks for the reminder. |
Internal size and external size are different got Bitallocator.
Hence creating separate function.
Signed-off-by: Ramesh Chander Ramesh.Chander@sandisk.com