Navigation Menu

Skip to content
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/BitmapFreelistManager: readability improvements #12719

Merged
merged 3 commits into from Jan 18, 2017

Conversation

xiexingguo
Copy link
Member

No description provided.

To keep pace with other private methods.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Copy link
Member

@liewegas liewegas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest looks good!

@@ -113,33 +113,32 @@ int BitmapFreelistManager::init()

// load meta
while (it->valid()) {
string k = it->key();
if (k == "bytes_per_block") {
if (it->key() == "bytes_per_block") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key() returns a string by value, not reference, so c_str() here is a use-after-free

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropped this change

@xiexingguo
Copy link
Member Author

retest this please

if (p[byte] & mask) {
int which_byte = start / 8;
int which_bit = start % 8;
if (p[which_byte] & byte_bit_mask[which_bit]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really better than 1 << which_bit ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt.

Repushed, can you check again?

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo xiexingguo force-pushed the xxg-wip-bluestore-1229 branch 2 times, most recently from 28b0011 to ea5d71c Compare January 11, 2017 03:40
Be slightly nice to who is looking at get_next_clear[set]_bit().

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

@liewegas Any more comments?

@liewegas liewegas merged commit a9bdb11 into ceph:master Jan 18, 2017
@xiexingguo xiexingguo deleted the xxg-wip-bluestore-1229 branch January 19, 2017 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants