]> 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)
committerCasey Bodley <cbodley@redhat.com>
Mon, 28 Jan 2019 20:19:43 +0000 (15:19 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 7e3dcca2bc23a23c1d4a22d6289bf733b22d11a2..242a39dac82fc56032db7958e394ccb8d7350856 100644 (file)
@@ -3270,6 +3270,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 6e371f909a447ea3a5dd08f8bf1c86f5966c8795..8afe70932fad51da2a98e983c7f8dd0f694e8877 100644 (file)
@@ -1483,6 +1483,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);
   };