This just lives in struct rgw_bucket now.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
*/
virtual int set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl) = 0;
- virtual int get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id) { return -ENOTSUP; }
-
/**
* stat an object
*/
info.bucket = bucket;
info.owner = policy.get_owner().get_id();
- uint64_t bucket_id;
- ret = rgwstore->get_bucket_id(bucket, &bucket_id);
+ ret = rgw_store_bucket_info_id(bucket.bucket_id, info);
if (ret < 0) {
- RGW_LOG(0) << "get_bucket_id returned " << ret << dendl;
- return ret;
- }
- ret = rgw_store_bucket_info_id(bucket_id, info);
- if (ret < 0) {
- RGW_LOG(0) << "can't store pool info: bucket_id=" << bucket_id << " ret=" << ret << dendl;
+ RGW_LOG(0) << "can't store pool info: bucket_id=" << bucket.bucket_id << " ret=" << ret << dendl;
return ret;
}
}
bufferlist aclbl;
bool existed;
bool pol_ret;
- uint64_t bucket_id;
RGWBucketInfo info;
rgw_obj obj(rgw_root_bucket, s->bucket_name_str);
if (ret == -EEXIST)
ret = 0;
- ret = rgwstore->get_bucket_id(s->bucket, &bucket_id);
- if (ret < 0)
- goto done;
-
info.owner = s->user.user_id;
info.bucket = s->bucket;
- rgw_store_bucket_info_id(bucket_id, info);
+ rgw_store_bucket_info_id(info.bucket.bucket_id, info);
done:
send_response();
return r;
}
-int RGWRados::get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id)
-{
- librados::IoCtx io_ctx;
- int r = open_bucket_ctx(bucket, io_ctx);
- if (r == -ENOENT)
- r = -ERR_NO_SUCH_BUCKET;
- if (r < 0)
- return r;
-
- *bucket_id = io_ctx.get_id();
- return 0;
-}
-
int RGWRados::get_bucket_stats(rgw_bucket& bucket, map<RGWObjCategory, RGWBucketStats>& stats)
{
rgw_bucket_dir_header header;
virtual int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime);
- virtual int get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id);
-
virtual bool supports_tmap() { return true; }
virtual int tmap_get(rgw_obj& obj, bufferlist& header, std::map<string, bufferlist>& m);
virtual int tmap_set(rgw_obj& obj, std::string& key, bufferlist& bl);