@@ -943,92 +943,90 @@ void cls_rgw_gc_remove(librados::ObjectWriteOperation& op, const vector<string>&
943943 op.exec (RGW_CLASS, RGW_GC_REMOVE, in);
944944}
945945
946- int cls_rgw_lc_get_head (IoCtx& io_ctx, const string& oid, cls_rgw_lc_obj_head& head )
946+ void cls_rgw_lc_get_head (ObjectReadOperation& op, bufferlist& out )
947947{
948- bufferlist in, out;
949- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_GET_HEAD, in, out);
950- if (r < 0 )
951- return r;
948+ bufferlist in;
949+ op.exec (RGW_CLASS, RGW_LC_GET_HEAD, in, &out, nullptr );
950+ }
952951
952+ int cls_rgw_lc_get_head_decode (const bufferlist& out, cls_rgw_lc_obj_head& head)
953+ {
953954 cls_rgw_lc_get_head_ret ret;
954955 try {
955956 auto iter = out.cbegin ();
956957 decode (ret, iter);
957958 } catch (ceph::buffer::error& err) {
958959 return -EIO;
959960 }
960- head = ret.head ;
961+ head = std::move ( ret.head ) ;
961962
962- return r ;
963+ return 0 ;
963964}
964965
965- int cls_rgw_lc_put_head (IoCtx& io_ctx , const string& oid, cls_rgw_lc_obj_head& head)
966+ void cls_rgw_lc_put_head (ObjectWriteOperation& op , const cls_rgw_lc_obj_head& head)
966967{
967- bufferlist in, out ;
968+ bufferlist in;
968969 cls_rgw_lc_put_head_op call;
969970 call.head = head;
970971 encode (call, in);
971- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_PUT_HEAD, in, out);
972- return r;
972+ op.exec (RGW_CLASS, RGW_LC_PUT_HEAD, in);
973973}
974974
975- int cls_rgw_lc_get_next_entry (IoCtx& io_ctx, const string& oid , const string& marker,
976- cls_rgw_lc_entry& entry )
975+ void cls_rgw_lc_get_next_entry (ObjectReadOperation& op , const string& marker,
976+ bufferlist& out )
977977{
978- bufferlist in, out ;
978+ bufferlist in;
979979 cls_rgw_lc_get_next_entry_op call;
980980 call.marker = marker;
981981 encode (call, in);
982- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_GET_NEXT_ENTRY, in, out);
983- if (r < 0 )
984- return r;
982+ op.exec (RGW_CLASS, RGW_LC_GET_NEXT_ENTRY, in, &out, nullptr );
983+ }
985984
985+ int cls_rgw_lc_get_next_entry_decode (const bufferlist& out, cls_rgw_lc_entry& entry)
986+ {
986987 cls_rgw_lc_get_next_entry_ret ret;
987988 try {
988989 auto iter = out.cbegin ();
989990 decode (ret, iter);
990991 } catch (ceph::buffer::error& err) {
991992 return -EIO;
992993 }
993- entry = ret.entry ;
994+ entry = std::move ( ret.entry ) ;
994995
995- return r ;
996+ return 0 ;
996997}
997998
998- int cls_rgw_lc_rm_entry (IoCtx& io_ctx, const string& oid ,
999- const cls_rgw_lc_entry& entry)
999+ void cls_rgw_lc_rm_entry (ObjectWriteOperation& op ,
1000+ const cls_rgw_lc_entry& entry)
10001001{
1001- bufferlist in, out ;
1002+ bufferlist in;
10021003 cls_rgw_lc_rm_entry_op call;
10031004 call.entry = entry;
10041005 encode (call, in);
1005- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_RM_ENTRY, in, out);
1006- return r;
1006+ op.exec (RGW_CLASS, RGW_LC_RM_ENTRY, in);
10071007}
10081008
1009- int cls_rgw_lc_set_entry (IoCtx& io_ctx, const string& oid ,
1010- const cls_rgw_lc_entry& entry)
1009+ void cls_rgw_lc_set_entry (ObjectWriteOperation& op ,
1010+ const cls_rgw_lc_entry& entry)
10111011{
10121012 bufferlist in, out;
10131013 cls_rgw_lc_set_entry_op call;
10141014 call.entry = entry;
10151015 encode (call, in);
1016- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_SET_ENTRY, in, out);
1017- return r;
1016+ op.exec (RGW_CLASS, RGW_LC_SET_ENTRY, in);
10181017}
10191018
1020- int cls_rgw_lc_get_entry (IoCtx& io_ctx , const string& oid ,
1021- const std::string& marker, cls_rgw_lc_entry& entry )
1019+ void cls_rgw_lc_get_entry (ObjectReadOperation& op , const std:: string& marker ,
1020+ bufferlist& out )
10221021{
1023- bufferlist in, out ;
1024- cls_rgw_lc_get_entry_op call{marker};;
1022+ bufferlist in;
1023+ cls_rgw_lc_get_entry_op call{marker};
10251024 encode (call, in);
1026- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_GET_ENTRY, in, out);
1027-
1028- if (r < 0 ) {
1029- return r;
1030- }
1025+ op.exec (RGW_CLASS, RGW_LC_GET_ENTRY, in, &out, nullptr );
1026+ }
10311027
1028+ int cls_rgw_lc_get_entry_decode (const bufferlist& out, cls_rgw_lc_entry& entry)
1029+ {
10321030 cls_rgw_lc_get_entry_ret ret;
10331031 try {
10341032 auto iter = out.cbegin ();
@@ -1038,28 +1036,24 @@ int cls_rgw_lc_get_entry(IoCtx& io_ctx, const string& oid,
10381036 }
10391037
10401038 entry = std::move (ret.entry );
1041- return r ;
1039+ return 0 ;
10421040}
10431041
1044- int cls_rgw_lc_list (IoCtx& io_ctx, const string& oid,
1045- const string& marker,
1046- uint32_t max_entries,
1047- vector<cls_rgw_lc_entry>& entries)
1042+ void cls_rgw_lc_list (ObjectReadOperation& op, const string& marker,
1043+ uint32_t max_entries, bufferlist& out)
10481044{
1049- bufferlist in, out;
1050- cls_rgw_lc_list_entries_op op;
1051-
1052- entries.clear ();
1053-
1054- op.marker = marker;
1055- op.max_entries = max_entries;
1045+ bufferlist in;
1046+ cls_rgw_lc_list_entries_op call;
1047+ call.marker = marker;
1048+ call.max_entries = max_entries;
10561049
1057- encode (op , in);
1050+ encode (call , in);
10581051
1059- int r = io_ctx.exec (oid, RGW_CLASS, RGW_LC_LIST_ENTRIES, in, out);
1060- if (r < 0 )
1061- return r;
1052+ op.exec (RGW_CLASS, RGW_LC_LIST_ENTRIES, in, &out, nullptr );
1053+ }
10621054
1055+ int cls_rgw_lc_list_decode (const bufferlist& out, std::vector<cls_rgw_lc_entry>& entries)
1056+ {
10631057 cls_rgw_lc_list_entries_ret ret;
10641058 try {
10651059 auto iter = out.cbegin ();
@@ -1072,7 +1066,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, const string& oid,
10721066 [](const cls_rgw_lc_entry& a, const cls_rgw_lc_entry& b)
10731067 { return a.bucket < b.bucket ; });
10741068 entries = std::move (ret.entries );
1075- return r ;
1069+ return 0 ;
10761070}
10771071
10781072void cls_rgw_mp_upload_part_info_update (librados::ObjectWriteOperation& op,
0 commit comments