@@ -186,7 +186,6 @@ bool BucketIndexAioManager::wait_for_completions(int valid_ret_code,
186186 return true ;
187187}
188188
189- // note: currently only called by testing code
190189void cls_rgw_bucket_init_index (ObjectWriteOperation& o)
191190{
192191 bufferlist in;
@@ -200,18 +199,24 @@ static bool issue_bucket_index_init_op(librados::IoCtx& io_ctx,
200199 bufferlist in;
201200 librados::ObjectWriteOperation op;
202201 op.create (true );
203- op. exec (RGW_CLASS, RGW_BUCKET_INIT_INDEX, in );
202+ cls_rgw_bucket_init_index (op );
204203 return manager->aio_operate (io_ctx, shard_id, oid, &op);
205204}
206205
206+ void cls_rgw_bucket_init_index2 (ObjectWriteOperation& o)
207+ {
208+ bufferlist in;
209+ o.exec (RGW_CLASS, RGW_BUCKET_INIT_INDEX2, in);
210+ }
211+
207212static bool issue_bucket_index_init_op2 (librados::IoCtx& io_ctx,
208213 const int shard_id,
209214 const string& oid,
210215 BucketIndexAioManager *manager) {
211216 bufferlist in;
212217 librados::ObjectWriteOperation op;
213218 op.create (true );
214- op. exec (RGW_CLASS, RGW_BUCKET_INIT_INDEX2, in );
219+ cls_rgw_bucket_init_index2 (op );
215220 return manager->aio_operate (io_ctx, shard_id, oid, &op);
216221}
217222
@@ -470,32 +475,6 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
470475 return 0 ;
471476}
472477
473- int cls_rgw_bi_get_vals (librados::IoCtx& io_ctx, const std::string oid,
474- std::set<std::string>& log_entries_wanted,
475- std::list<rgw_cls_bi_entry> *entries)
476- {
477- bufferlist in, out;
478- struct rgw_cls_bi_get_vals_op call;
479- call.log_entries_wanted = std::move (log_entries_wanted);
480- encode (call, in);
481- int r = io_ctx.exec (oid, RGW_CLASS, RGW_BI_GET_VALS, in, out);
482- if (r < 0 )
483- return r;
484-
485- struct rgw_cls_bi_list_ret op_ret;
486- auto iter = out.cbegin ();
487- try {
488- decode (op_ret, iter);
489- } catch (ceph::buffer::error& err) {
490- return -EIO;
491- }
492-
493- if (entries)
494- entries->swap (op_ret.entries );
495-
496- return 0 ;
497- }
498-
499478int cls_rgw_bi_put (librados::IoCtx& io_ctx, const string oid, const rgw_cls_bi_entry& entry)
500479{
501480 bufferlist in, out;
@@ -518,6 +497,21 @@ void cls_rgw_bi_put(ObjectWriteOperation& op, const string oid, const rgw_cls_bi
518497 op.exec (RGW_CLASS, RGW_BI_PUT, in);
519498}
520499
500+ void cls_rgw_bi_put_entries (librados::ObjectWriteOperation& op,
501+ std::vector<rgw_cls_bi_entry> entries,
502+ bool check_existing)
503+ {
504+ const auto call = rgw_cls_bi_put_entries_op{
505+ .entries = std::move (entries),
506+ .check_existing = check_existing
507+ };
508+
509+ bufferlist in;
510+ encode (call, in);
511+
512+ op.exec (RGW_CLASS, RGW_BI_PUT_ENTRIES, in);
513+ }
514+
521515/* nb: any entries passed in are replaced with the results of the cls
522516 * call, so caller does not need to clear entries between calls
523517 */
0 commit comments