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
osd: replace object_info_t::operator=() with decode() #13938
Conversation
src/osd/osd_types.h
Outdated
@@ -4117,7 +4117,7 @@ struct object_info_t { | |||
explicit object_info_t(bufferlist& bl) { | |||
decode(bl); | |||
} | |||
object_info_t operator=(bufferlist& bl) { | |||
object_info_t &operator=(bufferlist& bl) { |
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.
i think we should remove this method instead. and use decode()
when appropriate.
@dzafman what do you think?
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.
@tchaikov May I delete this function directly or append '= delete' to the function declaration?
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.
as long as there is no users of operator=
, i don't see why we cannot delete the default copy assignment operator.
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.
OK, I will delete it.
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.
@jimmyway please try compile the tree first. PG::_scan_snaps()
uses this function, that's why i suggested use decode()
directly.
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.
and what is deleted in your change is not the default copy assignment operator. the one created by compiler by default is
object_info_t& operator=(object_info_t&)
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.
sorry, I made mistakes, I will check it at first.
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.
Do you mean delete 'operation=' member function, and replace it to decode() in PG::_scan_snaps() ?
Signed-off-by: tang.jin <tang.jin@istuary.com>
Fix ceph#13938 Signed-off-by: Haomai Wang <haomai@xsky.com> (cherry picked from commit dc6d6ce)
Signed-off-by: tang.jin tang.jin@istuary.com