From: Casey Bodley Date: Thu, 14 Sep 2017 20:51:13 +0000 (-0400) Subject: rgw: add RGWBucketInfo overload for BucketShard::init X-Git-Tag: v13.0.1~210^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0caa1ca8a1d502128fd45237c1e7c13118a9711;p=ceph.git rgw: add RGWBucketInfo overload for BucketShard::init for use by callers that have already read the bucket instance info Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 161608a89d98..684bd1041c21 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6516,6 +6516,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 diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index d18398eba4d0..61a685e7edfa 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -2708,6 +2708,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 {