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
Crush: when get immediate parent quickly reply. #7181
Conversation
@@ -893,7 +893,8 @@ pair<string,string> CrushWrapper::get_immediate_parent(int id, int *_ret) | |||
string parent_id = name_map[b->id]; | |||
string parent_bucket_type = type_map[b->type]; | |||
loc = make_pair(parent_bucket_type, parent_id); | |||
ret = 0; | |||
*_ret = 0; |
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.
Need to check _ret first, which might be null, see below.
@smithfarm Thank you! I like your head portrait very much! |
@songbaisen Thanks for the kind compliment. You might like this one as well: http://happiehounds.com/wp-content/uploads/2012/04/rabbit3.jpg |
@smithfarm Yes it really look very interesting.Thanks for your sharing. |
I think this change is good and makes sense. @liewegas What do you think? |
ret = 0; | ||
if (_ret) | ||
*_ret = 0; | ||
return loc; |
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.
if we do this, then we should get rid of int ret and loc at the top, move them into the inner scope, and make the end of the method unconditionally set *_ret = -ENOENT and return pair<string,string>().
@liewegas Thank you for your good advice! @xiexingguo Please review it.Thank you! |
ret = 0; | ||
if (_ret) | ||
*_ret = 0; | ||
return make_pair(parent_bucket_type, parent_id); |
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.
There seems to be an extra whitespace, otherwise looks good to me.
Besides, your signed-off line is not right, should be:
instead of :
|
imho, there is no need to file a tracker ticket for this change as this is just a cleanup try. |
@tchaikov Indeed:-) |
@xiexingguo @tchaikov Thanks for two sir. |
Fixes: ceph#14334 Signed-off-by: song baisen <song.baisen@zte.com.cn>
crush: reply quickly from get_immediate_parent Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
Crush: when get immediate parent quickly reply.
Fixes: #14334
Signed-off-by: song baisen song.baisen@zte.com.cn