]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add RGWBucketInfo overload for BucketShard::init
authorCasey Bodley <cbodley@redhat.com>
Thu, 14 Sep 2017 20:51:13 +0000 (16:51 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 22 Jan 2018 22:02:07 +0000 (17:02 -0500)
for use by callers that have already read the bucket instance info

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit f0caa1ca8a1d502128fd45237c1e7c13118a9711)

src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index cb2dc13fd0d6f6053dec6612735e193606ffff14..fc480a516de6b16da58f4b3e6148855ad8d121db 100644 (file)
@@ -6566,6 +6566,21 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket, int sid)
   return 0;
 }
 
+int RGWRados::BucketShard::init(const RGWBucketInfo& bucket_info, int sid)
+{
+  bucket = bucket_info.bucket;
+  shard_id = sid;
+
+  int ret = store->open_bucket_index_shard(bucket_info, index_ctx, shard_id, &bucket_obj);
+  if (ret < 0) {
+    ldout(store->ctx(), 0) << "ERROR: open_bucket_index_shard() returned ret=" << ret << dendl;
+    return ret;
+  }
+  ldout(store->ctx(), 20) << " bucket index object: " << bucket_obj << dendl;
+
+  return 0;
+}
+
 
 /* Execute @handler on last item in bucket listing for bucket specified
  * in @bucket_info. @obj_prefix and @obj_delim narrow down the listing
index 31f88a86e8b6f270ecd828a331d7e5d2b1cdb72d..faabb9cec21631c00dd4b018644efd97de239640 100644 (file)
@@ -2692,6 +2692,7 @@ public:
     explicit BucketShard(RGWRados *_store) : store(_store), shard_id(-1) {}
     int init(const rgw_bucket& _bucket, const rgw_obj& obj);
     int init(const rgw_bucket& _bucket, int sid);
+    int init(const RGWBucketInfo& bucket_info, int sid);
   };
 
   class Object {