]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add BucketShard::init overload for bucket_info,obj
authorCasey Bodley <cbodley@redhat.com>
Fri, 25 Jan 2019 21:17:19 +0000 (16:17 -0500)
committerNathan Cutler <ncutler@suse.com>
Mon, 22 Jul 2019 10:17:47 +0000 (12:17 +0200)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c6c445f6074df113a28adcae89248b909d031f8e)

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

index b798291bd9325a4f4a054f738ea86aa133bcef31..61d20fa8f39cc74797b044e4f53f71564ae8efba 100644 (file)
@@ -6816,6 +6816,23 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket,
   return 0;
 }
 
+int RGWRados::BucketShard::init(const RGWBucketInfo& bucket_info,
+                                const rgw_obj& obj)
+{
+  bucket = bucket_info.bucket;
+
+  int ret = store->open_bucket_index_shard(bucket_info, index_ctx,
+                                           obj.get_hash_object(), &bucket_obj,
+                                           &shard_id);
+  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;
+}
+
 int RGWRados::BucketShard::init(const RGWBucketInfo& bucket_info, int sid)
 {
   bucket = bucket_info.bucket;
index fe4e8e708724ef3d376e7293ce6579e7198f350e..8ffae51c4d5dcc2740a68728549f4826f7da4fe6 100644 (file)
@@ -2742,6 +2742,7 @@ public:
     explicit BucketShard(RGWRados *_store) : store(_store), shard_id(-1) {}
     int init(const rgw_bucket& _bucket, const rgw_obj& obj, RGWBucketInfo* out);
     int init(const rgw_bucket& _bucket, int sid, RGWBucketInfo* out);
+    int init(const RGWBucketInfo& bucket_info, const rgw_obj& obj);
     int init(const RGWBucketInfo& bucket_info, int sid);
   };