osd/scrub_machine: pass an instance of event to post_event()
instead of passing an intrusive_ptr<> to it, pass an instance of event
to post_event(). for couple reasons:
* post_event() is able to create an intrusive_ptr<> from the event
passed to it using event.intrusive_from_this() which creates a clone
of the original event. but since the overhead of creating scrub events
is relative low. and presumably, it is not the bottleneck of the
overall performance of Ceph, so it should be fine.
* simpler this way. so we don't need to repeat
`boost::intrusive_ptr<EventName>(new EventName{})`
* more consistent this way. we use the same variant of `post_event()`
elsewhere.
* for silencing the warning from GCC-11, like:
../src/osd/scrub_machine.cc:323:64: note: returned from ‘static void* boost::statechart::event<MostDerived, Allocator>::operator new(std::size_t) [with MostDerived = Scrub::GotReplicas; Allocator =
std::allocator<boost::statechart::none>]’
../src/osd/scrub_machine.cc: In constructor ‘Scrub::WaitReplicas::WaitReplicas(boost::statechart::state<Scrub::WaitReplicas, Scrub::ActiveScrubbing>::my_context)’:
../src/osd/scrub_machine.cc:346:64: warning: ‘static void boost::statechart::event<MostDerived, Allocator>::operator delete(void*) [with MostDerived = Scrub::GotReplicas; Allocator =
std::allocator<boost::statechart::none>]’ called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
346 | post_event(boost::intrusive_ptr<GotReplicas>(new GotReplicas{}));
|
this warning is a false alarm. but it is distracting.