]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: pass list_parts_each_t function by lvalue reference
authorKefu Chai <tchaikov@gmail.com>
Wed, 16 Jul 2025 08:45:55 +0000 (16:45 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 16 Jul 2025 08:52:33 +0000 (16:52 +0800)
commit917a2dde418d519dfd8105177725ccedab3e82fe
tree6d7f24579a0beb1a8f7ed3209bb1ce3082456386
parentc2bee4c7922ad467c591e8f7faea17139f220a3f
rgw: pass list_parts_each_t function by lvalue reference

list_parts_each_t is an alias of
`fu2::unique_function<int(const Part&) const>`, which is a non copyable
function. so in theory, we cannot copy it. and in the recent version of
function2, unique_function is not coyable anymore. if we bump up the
vendored function2.hpp, the build breaks.

so, in this change, we change the virtual function of
`Object::list_parts()` from passing the plain value of
`list_parts_each_t` to rvalue reference `list_parts_each_t` so that we
don't need to copy this non-copyable function. this allows us to
keep in sync with upstream function2, and to be symantically correct
regarding to the unique-ness of the functor.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/rgw/driver/posix/rgw_sal_posix.cc
src/rgw/driver/posix/rgw_sal_posix.h
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/rgw_sal.h
src/rgw/rgw_sal_dbstore.cc
src/rgw/rgw_sal_dbstore.h
src/rgw/rgw_sal_filter.cc
src/rgw/rgw_sal_filter.h