From a8450005c7179856db97b64cd1abd18a88790af4 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 28 Oct 2011 11:48:38 -0700 Subject: [PATCH] rgw: cleanup, remove unused user_id Some access methods required user_id param, but that was never really used. At this point we should just remove them. --- src/rgw/rgw_access.h | 34 +++++++++------------ src/rgw/rgw_admin.cc | 9 +++--- src/rgw/rgw_cache.h | 20 ++++++------ src/rgw/rgw_fs.cc | 20 ++++++------ src/rgw/rgw_fs.h | 18 +++++------ src/rgw/rgw_op.cc | 44 +++++++++++++-------------- src/rgw/rgw_rados.cc | 72 ++++++++++++++++++-------------------------- src/rgw/rgw_rados.h | 30 +++++++++--------- src/rgw/rgw_tools.cc | 4 +-- src/rgw/rgw_user.cc | 22 +++++++------- src/rgw/rgw_user.h | 4 +-- 11 files changed, 129 insertions(+), 148 deletions(-) diff --git a/src/rgw/rgw_access.h b/src/rgw/rgw_access.h index 204dd38506cce..0155be16bb133 100644 --- a/src/rgw/rgw_access.h +++ b/src/rgw/rgw_access.h @@ -34,9 +34,9 @@ public: virtual int initialize(CephContext *cct) = 0; virtual void finalize() {} /** prepare a listing of all buckets. */ - virtual int list_buckets_init(std::string& id, RGWAccessHandle *handle) = 0; + virtual int list_buckets_init(RGWAccessHandle *handle) = 0; /** get the next bucket in the provided listing context. */ - virtual int list_buckets_next(std::string& id, RGWObjEnt& obj, RGWAccessHandle *handle) = 0; + virtual int list_buckets_next(RGWObjEnt& obj, RGWAccessHandle *handle) = 0; virtual int log_list_init(const string& prefix, RGWAccessHandle *handle) { return -ENOENT; } virtual int log_list_next(RGWAccessHandle handle, string *name) { return -ENOENT; } @@ -46,7 +46,6 @@ public: /** * get listing of the objects in a bucket. - * id: ignored in current implementations * bucket: bucket to list contents of * max: maximum number of results to return * prefix: only return results that match this prefix @@ -58,33 +57,33 @@ public: * common_prefixes: if delim is filled in, any matching prefixes are placed * here. */ - virtual int list_objects(std::string& id, rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, + virtual int list_objects(rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, std::string& marker, std::vector& result, map& common_prefixes, bool get_content_type, std::string& ns, bool *is_truncated, RGWAccessListFilter *filter) = 0; /** Create a new bucket*/ - virtual int create_bucket(std::string& id, rgw_bucket& bucket, + virtual int create_bucket(string& owner, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive = true, uint64_t auid = 0) = 0; virtual int add_bucket_placement(std::string& new_placement) { return 0; } - virtual int create_pools(std::string& id, vector& names, vector& retcodes, int auid = 0) { return -ENOTSUP; } + virtual int create_pools(vector& names, vector& retcodes, int auid = 0) { return -ENOTSUP; } /** write an object to the storage device in the appropriate pool with the given stats */ - virtual int put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, time_t *mtime, + virtual int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map* rmattrs) = 0; - virtual int put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + virtual int put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len) = 0; - virtual int aio_put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + virtual int aio_put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len, void **handle) { return -ENOTSUP; } /* note that put_obj doesn't set category on an object, only use it for none user objects */ - int put_obj(void *ctx, std::string& id, rgw_obj& obj, const char *data, size_t len, + int put_obj(void *ctx, rgw_obj& obj, const char *data, size_t len, time_t *mtime, map& attrs) { - int ret = put_obj_data(ctx, id, obj, data, -1, len); + int ret = put_obj_data(ctx, obj, data, -1, len); if (ret >= 0) { - ret = put_obj_meta(ctx, id, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, false, NULL); + ret = put_obj_meta(ctx, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, false, NULL); } return ret; } @@ -98,7 +97,6 @@ public: /** * Copy an object. - * id: unused (well, it's passed to put_obj) * dest_bucket: the bucket to copy into * dest_obj: the object to copy into * src_bucket: the bucket to copy from @@ -109,7 +107,7 @@ public: * err: stores any errors resulting from the get of the original object * Returns: 0 on success, -ERR# otherwise. */ - virtual int copy_obj(void *ctx, std::string& id, rgw_obj& dest_obj, + virtual int copy_obj(void *ctx, rgw_obj& dest_obj, rgw_obj& src_obj, time_t *mtime, const time_t *mod_ptr, @@ -121,12 +119,11 @@ public: struct rgw_err *err) = 0; /** * Delete a bucket. - * id: unused in implementations * bucket: the name of the bucket to delete * Returns 0 on success, -ERR# otherwise. */ - virtual int delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool) = 0; - virtual int purge_buckets(std::string& id, vector& buckets) { return -ENOTSUP; } + virtual int delete_bucket(rgw_bucket& bucket, bool remove_pool) = 0; + virtual int purge_buckets(vector& buckets) { return -ENOTSUP; } virtual int set_buckets_enabled(std::vector& buckets, bool enabled) { return -ENOTSUP; } virtual int bucket_suspended(rgw_bucket& bucket, bool *suspended) { @@ -136,12 +133,11 @@ public: /** * Delete an object. - * id: unused in current implementations * bucket: name of the bucket storing the object * obj: name of the object to delete * Returns: 0 on success, -ERR# otherwise. */ - virtual int delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync = true) = 0; + virtual int delete_obj(void *ctx, rgw_obj& obj, bool sync = true) = 0; /** * Get data about an object out of RADOS and into memory. diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 4972c65da8cb6..b272af426a9e0 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -397,7 +397,7 @@ static void remove_old_indexes(RGWUserInfo& old_info, RGWUserInfo new_info) if (!old_info.user_email.empty() && old_info.user_email.compare(new_info.user_email) != 0) { - ret = rgw_remove_email_index(new_info.user_id, old_info.user_email); + ret = rgw_remove_email_index(old_info.user_email); if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not remove index for email " << old_info.user_email << " return code: " << ret << std::endl; success = false; @@ -409,7 +409,7 @@ static void remove_old_indexes(RGWUserInfo& old_info, RGWUserInfo new_info) RGWAccessKey& swift_key = old_iter->second; map::iterator new_iter = new_info.swift_keys.find(swift_key.id); if (new_iter == new_info.swift_keys.end()) { - ret = rgw_remove_swift_name_index(new_info.user_id, swift_key.id); + ret = rgw_remove_swift_name_index(swift_key.id); if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not remove index for swift_name " << swift_key.id << " return code: " << ret << std::endl; success = false; @@ -901,7 +901,6 @@ int main(int argc, char **argv) } if (opt_cmd == OPT_BUCKETS_LIST) { - string id; RGWAccessHandle handle; formatter->reset(); @@ -920,11 +919,11 @@ int main(int argc, char **argv) } } } else { - if (store->list_buckets_init(id, &handle) < 0) { + if (store->list_buckets_init(&handle) < 0) { cerr << "list buckets: no buckets found" << std::endl; } else { RGWObjEnt obj; - while (store->list_buckets_next(id, obj, &handle) >= 0) { + while (store->list_buckets_next(obj, &handle) >= 0) { formatter->dump_string("bucket", obj.name); } } diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index 4e6664bc84ede..1fb8a4807720f 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -171,29 +171,29 @@ public: RGWCache() {} int set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl); - int put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, time_t *mtime, + int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map* rmattrs); - int put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + int put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len); int get_obj(void *ctx, void **handle, rgw_obj& obj, char **data, off_t ofs, off_t end); int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, map *attrs); - int delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync); + int delete_obj(void *ctx, rgw_obj& obj, bool sync); }; template -int RGWCache::delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync) +int RGWCache::delete_obj(void *ctx, rgw_obj& obj, bool sync) { rgw_bucket bucket; string oid; normalize_bucket_and_obj(obj.bucket, obj.object, bucket, oid); if (bucket.name[0] != '.') - return T::delete_obj(ctx, id, obj, sync); + return T::delete_obj(ctx, obj, sync); string name = normal_name(obj); cache.remove(name); @@ -201,7 +201,7 @@ int RGWCache::delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync) ObjectCacheInfo info; distribute(obj, info, REMOVE_OBJ); - return T::delete_obj(ctx, id, obj, sync); + return T::delete_obj(ctx, obj, sync); } template @@ -277,7 +277,7 @@ int RGWCache::set_attr(void *ctx, rgw_obj& obj, const char *attr_name, buffer } template -int RGWCache::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, time_t *mtime, +int RGWCache::put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map* rmattrs) { @@ -292,7 +292,7 @@ int RGWCache::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t info.status = 0; info.flags = CACHE_FLAG_XATTRS; } - int ret = T::put_obj_meta(ctx, id, obj, size, mtime, attrs, category, exclusive, rmattrs); + int ret = T::put_obj_meta(ctx, obj, size, mtime, attrs, category, exclusive, rmattrs); if (cacheable) { string name = normal_name(bucket, oid); if (ret >= 0) { @@ -309,7 +309,7 @@ int RGWCache::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t } template -int RGWCache::put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, +int RGWCache::put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len) { rgw_bucket bucket; @@ -327,7 +327,7 @@ int RGWCache::put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const ch info.status = 0; info.flags = CACHE_FLAG_DATA; } - int ret = T::put_obj_data(ctx, id, obj, data, ofs, len); + int ret = T::put_obj_data(ctx, obj, data, ofs, len); if (cacheable) { string name = normal_name(bucket, oid); if (ret >= 0) { diff --git a/src/rgw/rgw_fs.cc b/src/rgw/rgw_fs.cc index 9f213464ddfdd..c76b4193a5404 100644 --- a/src/rgw/rgw_fs.cc +++ b/src/rgw/rgw_fs.cc @@ -33,7 +33,7 @@ int RGWFS::initialize(CephContext *cct) return 0; } -int RGWFS::list_buckets_init(string& id, RGWAccessHandle *handle) +int RGWFS::list_buckets_init(RGWAccessHandle *handle) { DIR *dir = opendir(DIR_NAME); struct rgwfs_state *state; @@ -54,7 +54,7 @@ int RGWFS::list_buckets_init(string& id, RGWAccessHandle *handle) return 0; } -int RGWFS::list_buckets_next(string& id, RGWObjEnt& obj, RGWAccessHandle *handle) +int RGWFS::list_buckets_next(RGWObjEnt& obj, RGWAccessHandle *handle) { struct rgwfs_state *state; struct dirent *dirent; @@ -96,7 +96,7 @@ int RGWFS::obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, ma return -ENOTSUP; } -int RGWFS::list_objects(string& id, rgw_bucket& bucket, int max, string& prefix, string& delim, +int RGWFS::list_objects(rgw_bucket& bucket, int max, string& prefix, string& delim, string& marker, vector& result, map& common_prefixes, bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter) { @@ -172,7 +172,7 @@ int RGWFS::list_objects(string& id, rgw_bucket& bucket, int max, string& prefix, } -int RGWFS::create_bucket(std::string& id, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive, uint64_t auid) +int RGWFS::create_bucket(std::string& owner, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive, uint64_t auid) { int len = strlen(DIR_NAME) + 1 + bucket.name.size() + 1; char buf[len]; @@ -204,7 +204,7 @@ int RGWFS::create_bucket(std::string& id, rgw_bucket& bucket, map& attrs, RGWObjCategory category, bool exclusive, map *rmattrs) @@ -253,7 +253,7 @@ done_err: return -errno; } -int RGWFS::put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, +int RGWFS::put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t size) { rgw_bucket& bucket = obj.bucket; @@ -294,7 +294,7 @@ done_err: return r; } -int RGWFS::copy_obj(void *ctx, std::string& id, rgw_obj& dest_obj, +int RGWFS::copy_obj(void *ctx, rgw_obj& dest_obj, rgw_obj& src_obj, time_t *mtime, const time_t *mod_ptr, @@ -331,12 +331,12 @@ int RGWFS::copy_obj(void *ctx, std::string& id, rgw_obj& dest_obj, } attrs = attrset; - ret = put_obj(ctx, id, dest_obj, data, ret, mtime, attrs); + ret = put_obj(ctx, dest_obj, data, ret, mtime, attrs); return ret; } -int RGWFS::delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool) +int RGWFS::delete_bucket(rgw_bucket& bucket, bool remove_pool) { int len = strlen(DIR_NAME) + 1 + bucket.name.size() + 1; char buf[len]; @@ -349,7 +349,7 @@ int RGWFS::delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool) } -int RGWFS::delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync) +int RGWFS::delete_obj(void *ctx, rgw_obj& obj, bool sync) { rgw_bucket& bucket = obj.bucket; std::string& oid = obj.object; diff --git a/src/rgw/rgw_fs.h b/src/rgw/rgw_fs.h index 56e2959936a56..1d209e5fc2903 100644 --- a/src/rgw/rgw_fs.h +++ b/src/rgw/rgw_fs.h @@ -11,20 +11,20 @@ class RGWFS : public RGWAccess }; public: virtual int initialize(CephContext *cct); - int list_buckets_init(std::string& id, RGWAccessHandle *handle); - int list_buckets_next(std::string& id, RGWObjEnt& obj, RGWAccessHandle *handle); + int list_buckets_init(RGWAccessHandle *handle); + int list_buckets_next(RGWObjEnt& obj, RGWAccessHandle *handle); - int list_objects(std::string& id, rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, + int list_objects(rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, std::string& marker, std::vector& result, map& common_prefixes, bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter); - int create_bucket(std::string& id, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive, uint64_t auid=0); - int put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, time_t *mtime, + int create_bucket(std::string& owner, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive, uint64_t auid=0); + int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map *rmattrs); - int put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + int put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t size); - int copy_obj(void *ctx, std::string& id, rgw_obj& dest_obj, + int copy_obj(void *ctx, rgw_obj& dest_obj, rgw_obj& src_obj, time_t *mtime, const time_t *mod_ptr, @@ -34,8 +34,8 @@ public: map& attrs, RGWObjCategory category, struct rgw_err *err); - int delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool); - int delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync); + int delete_bucket(rgw_bucket& bucket, bool remove_pool); + int delete_obj(void *ctx, rgw_obj& obj, bool sync); int get_attr(const char *name, int fd, char **attr); int get_attr(const char *name, const char *path, char **attr); diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 21456d5e45937..bf435cabba337 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -462,7 +462,7 @@ void RGWListBucket::execute() if (ret < 0) goto done; - ret = rgwstore->list_objects(s->user.user_id, s->bucket, max, prefix, delimiter, marker, objs, common_prefixes, + ret = rgwstore->list_objects(s->bucket, max, prefix, delimiter, marker, objs, common_prefixes, !!(s->prot_flags & RGW_REST_SWIFT), no_ns, &is_truncated, NULL); done: @@ -541,7 +541,7 @@ void RGWDeleteBucket::execute() ret = -EINVAL; if (s->bucket_name) { - ret = rgwstore->delete_bucket(s->user.user_id, s->bucket, false); + ret = rgwstore->delete_bucket(s->bucket, false); if (ret == 0) { ret = rgw_remove_user_bucket_info(s->user.user_id, s->bucket, false); @@ -700,7 +700,7 @@ void RGWPutObj::execute() // For the first call to put_obj_data, pass -1 as the offset to // do a write_full. void *handle; - ret = rgwstore->aio_put_obj_data(s->obj_ctx, s->user.user_id, obj, + ret = rgwstore->aio_put_obj_data(s->obj_ctx, obj, data, ((ofs == 0) ? -1 : ofs), len, &handle); if (ret < 0) @@ -778,12 +778,12 @@ void RGWPutObj::execute() if (ret < 0) goto done_err; if (created_obj) { - ret = rgwstore->delete_obj(NULL, s->user.user_id, obj, false); + ret = rgwstore->delete_obj(NULL, obj, false); if (ret < 0) goto done; } } else { - ret = rgwstore->put_obj_meta(s->obj_ctx, s->user.user_id, obj, s->obj_size, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, NULL); + ret = rgwstore->put_obj_meta(s->obj_ctx, obj, s->obj_size, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, NULL); if (ret < 0) goto done_err; @@ -809,7 +809,7 @@ done: done_err: if (created_obj) - rgwstore->delete_obj(s->obj_ctx, s->user.user_id, obj); + rgwstore->delete_obj(s->obj_ctx, obj); drain_pending(pending); send_response(); } @@ -849,7 +849,7 @@ void RGWPutObjMetadata::execute() } } - ret = rgwstore->put_obj_meta(s->obj_ctx, s->user.user_id, obj, s->obj_size, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, &rmattrs); + ret = rgwstore->put_obj_meta(s->obj_ctx, obj, s->obj_size, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, &rmattrs); done: send_response(); @@ -869,7 +869,7 @@ void RGWDeleteObj::execute() rgw_obj obj(s->bucket, s->object_str); if (s->object) { rgwstore->set_atomic(s->obj_ctx, obj); - ret = rgwstore->delete_obj(s->obj_ctx, s->user.user_id, obj); + ret = rgwstore->delete_obj(s->obj_ctx, obj); } send_response(); @@ -988,7 +988,7 @@ void RGWCopyObj::execute() rgwstore->set_atomic(s->obj_ctx, src_obj); rgwstore->set_atomic(s->obj_ctx, dst_obj); - ret = rgwstore->copy_obj(s->obj_ctx, s->user.user_id, + ret = rgwstore->copy_obj(s->obj_ctx, dst_obj, src_obj, &mtime, @@ -1056,7 +1056,7 @@ static int rebuild_policy(ACLOwner *owner, RGWAccessControlPolicy& src, RGWAcces ACLGranteeType& type = src_grant->get_type(); ACLGrant new_grant; bool grant_ok = false; - string id; + string uid; RGWUserInfo grant_user; switch (type.get_type()) { case ACL_TYPE_EMAIL_USER: @@ -1067,19 +1067,19 @@ static int rebuild_policy(ACLOwner *owner, RGWAccessControlPolicy& src, RGWAcces dout(10) << "grant user email not found or other error" << dendl; return -ERR_UNRESOLVABLE_EMAIL; } - id = grant_user.user_id; + uid = grant_user.user_id; } case ACL_TYPE_CANON_USER: { if (type.get_type() == ACL_TYPE_CANON_USER) - id = src_grant->get_id(); + uid = src_grant->get_id(); - if (grant_user.user_id.empty() && rgw_get_user_info_by_uid(id, grant_user) < 0) { - dout(10) << "grant user does not exist:" << id << dendl; + if (grant_user.user_id.empty() && rgw_get_user_info_by_uid(uid, grant_user) < 0) { + dout(10) << "grant user does not exist:" << uid << dendl; return -EINVAL; } else { ACLPermission& perm = src_grant->get_permission(); - new_grant.set_canon(id, grant_user.display_name, perm.get_permissions()); + new_grant.set_canon(uid, grant_user.display_name, perm.get_permissions()); grant_ok = true; dout(10) << "new grant: " << new_grant.get_id() << ":" << grant_user.display_name << dendl; } @@ -1261,7 +1261,7 @@ void RGWInitMultipart::execute() obj.init(s->bucket, tmp_obj_name, s->object_str, mp_ns); // the meta object will be indexed with 0 size, we c - ret = rgwstore->put_obj_meta(s->obj_ctx, s->user.user_id, obj, 0, NULL, attrs, RGW_OBJ_CATEGORY_MULTIMETA, true, NULL); + ret = rgwstore->put_obj_meta(s->obj_ctx, obj, 0, NULL, attrs, RGW_OBJ_CATEGORY_MULTIMETA, true, NULL); } while (ret == -EEXIST); done: send_response(); @@ -1410,7 +1410,7 @@ void RGWCompleteMultipart::execute() target_obj.init(s->bucket, s->object_str); rgwstore->set_atomic(s->obj_ctx, target_obj); - ret = rgwstore->put_obj_meta(s->obj_ctx, s->user.user_id, target_obj, 0, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, NULL); + ret = rgwstore->put_obj_meta(s->obj_ctx, target_obj, 0, NULL, attrs, RGW_OBJ_CATEGORY_MAIN, false, NULL); if (ret < 0) goto done; @@ -1435,11 +1435,11 @@ void RGWCompleteMultipart::execute() for (obj_iter = obj_parts.begin(); obj_iter != obj_parts.end(); ++obj_iter) { string oid = mp.get_part(obj_iter->second.num); rgw_obj obj(s->bucket, oid, s->object_str, mp_ns); - rgwstore->delete_obj(s->obj_ctx, s->user.user_id, obj); + rgwstore->delete_obj(s->obj_ctx, obj); } // and also remove the metadata obj meta_obj.init(s->bucket, meta_oid, s->object_str, mp_ns); - rgwstore->delete_obj(s->obj_ctx, s->user.user_id, meta_obj); + rgwstore->delete_obj(s->obj_ctx, meta_obj); done: send_response(); @@ -1480,13 +1480,13 @@ void RGWAbortMultipart::execute() for (obj_iter = obj_parts.begin(); obj_iter != obj_parts.end(); ++obj_iter) { string oid = mp.get_part(obj_iter->second.num); rgw_obj obj(s->bucket, oid, s->object_str, mp_ns); - ret = rgwstore->delete_obj(s->obj_ctx, s->user.user_id, obj); + ret = rgwstore->delete_obj(s->obj_ctx, obj); if (ret < 0 && ret != -ENOENT) goto done; } // and also remove the metadata obj meta_obj.init(s->bucket, meta_oid, s->object_str, mp_ns); - ret = rgwstore->delete_obj(s->obj_ctx, s->user.user_id, meta_obj); + ret = rgwstore->delete_obj(s->obj_ctx, meta_obj); if (ret == -ENOENT) { ret = -ERR_NO_SUCH_BUCKET; } @@ -1552,7 +1552,7 @@ void RGWListBucketMultiparts::execute() } } marker_meta = marker.get_meta(); - ret = rgwstore->list_objects(s->user.user_id, s->bucket, max_uploads, prefix, delimiter, marker_meta, objs, common_prefixes, + ret = rgwstore->list_objects(s->bucket, max_uploads, prefix, delimiter, marker_meta, objs, common_prefixes, !!(s->prot_flags & RGW_REST_SWIFT), mp_ns, &is_truncated, &mp_filter); if (objs.size()) { vector::iterator iter; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 48d15fa1fd446..f5177dbd8d19b 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -172,11 +172,10 @@ int RGWRados::open_bucket_ctx(rgw_bucket& bucket, librados::IoCtx& io_ctx) /** * set up a bucket listing. - * id is ignored * handle is filled in. * Returns 0 on success, -ERR# otherwise. */ -int RGWRados::list_buckets_init(std::string& id, RGWAccessHandle *handle) +int RGWRados::list_buckets_init(RGWAccessHandle *handle) { librados::ObjectIterator *state = new librados::ObjectIterator(root_pool_ctx.objects_begin()); *handle = (RGWAccessHandle)state; @@ -185,12 +184,11 @@ int RGWRados::list_buckets_init(std::string& id, RGWAccessHandle *handle) /** * get the next bucket in the listing. - * id is ignored * obj is filled in, * handle is updated. * returns 0 on success, -ERR# otherwise. */ -int RGWRados::list_buckets_next(std::string& id, RGWObjEnt& obj, RGWAccessHandle *handle) +int RGWRados::list_buckets_next(RGWObjEnt& obj, RGWAccessHandle *handle) { librados::ObjectIterator *state = (librados::ObjectIterator *)*handle; @@ -333,7 +331,6 @@ int RGWRados::decode_policy(bufferlist& bl, ACLOwner *owner) /** * get listing of the objects in a bucket. - * id: ignored. * bucket: bucket to list contents of * max: maximum number of results to return * prefix: only return results that match this prefix @@ -345,7 +342,7 @@ int RGWRados::decode_policy(bufferlist& bl, ACLOwner *owner) * common_prefixes: if delim is filled in, any matching prefixes are placed * here. */ -int RGWRados::list_objects(string& id, rgw_bucket& bucket, int max, string& prefix, string& delim, +int RGWRados::list_objects(rgw_bucket& bucket, int max, string& prefix, string& delim, string& marker, vector& result, map& common_prefixes, bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter) { @@ -398,10 +395,9 @@ int RGWRados::list_objects(string& id, rgw_bucket& bucket, int max, string& pref /** * create a bucket with name bucket and the given list of attrs - * if auid is set, it sets the auid of the underlying rados io_ctx * returns 0 on success, -ERR# otherwise. */ -int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket, +int RGWRados::create_bucket(string& owner, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive, uint64_t auid) @@ -470,11 +466,11 @@ int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket, RGWBucketInfo info; info.bucket = bucket; - info.owner = id; + info.owner = owner; ret = store_bucket_info(info); if (ret < 0) { dout(0) << "failed to store bucket info, removing bucket" << dendl; - delete_bucket(id, bucket, true); + delete_bucket(bucket, true); return ret; } } @@ -488,15 +484,14 @@ int RGWRados::store_bucket_info(RGWBucketInfo& info) bufferlist bl; ::encode(info, bl); - string unused; - int ret = rgw_put_obj(unused, pi_buckets_rados, info.bucket.name, bl.c_str(), bl.length()); + int ret = rgw_put_obj(info.owner, pi_buckets_rados, info.bucket.name, bl.c_str(), bl.length()); if (ret < 0) return ret; char bucket_char[16]; snprintf(bucket_char, sizeof(bucket_char), ".%lld", (long long unsigned)info.bucket.bucket_id); string bucket_id_string(bucket_char); - ret = rgw_put_obj(unused, pi_buckets_rados, bucket_id_string, bl.c_str(), bl.length()); + ret = rgw_put_obj(info.owner, pi_buckets_rados, bucket_id_string, bl.c_str(), bl.length()); dout(0) << "store_bucket_info: bucket=" << info.bucket << " owner " << info.owner << dendl; return 0; @@ -512,12 +507,11 @@ int RGWRados::select_bucket_placement(string& bucket_name, rgw_bucket& bucket) rgw_obj obj(pi_buckets_rados, avail_pools); int ret = tmap_get(obj, header, m); if (ret < 0 || !m.size()) { - string id; vector names; names.push_back(default_storage_pool); vector retcodes; bufferlist bl; - ret = create_pools(id, names, retcodes); + ret = create_pools(names, retcodes); if (ret < 0) return ret; ret = tmap_set(obj, default_storage_pool, bl); @@ -558,7 +552,7 @@ int RGWRados::add_bucket_placement(std::string& new_pool) return ret; } -int RGWRados::create_pools(std::string& id, vector& names, vector& retcodes, int auid) +int RGWRados::create_pools(vector& names, vector& retcodes, int auid) { vector::iterator iter; vector completions; @@ -594,7 +588,6 @@ int RGWRados::create_pools(std::string& id, vector& names, vector& /** * Write/overwrite an object to the bucket storage. - * id: ignored * bucket: the bucket to store the object in * obj: the object name/key * data: the object contents/value @@ -604,7 +597,7 @@ int RGWRados::create_pools(std::string& id, vector& names, vector& * exclusive: create object exclusively * Returns: 0 on success, -ERR# otherwise. */ -int RGWRados::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, +int RGWRados::put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map* rmattrs) { @@ -682,7 +675,6 @@ int RGWRados::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t s /** * Write/overwrite an object to the bucket storage. - * id: ignored * bucket: the bucket to store the object in * obj: the object name/key * data: the object contents/value @@ -692,17 +684,17 @@ int RGWRados::put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t s * attrs: all the given attrs are written to bucket storage for the given object * Returns: 0 on success, -ERR# otherwise. */ -int RGWRados::put_obj_data(void *ctx, std::string& id, rgw_obj& obj, +int RGWRados::put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len) { void *handle; - int r = aio_put_obj_data(ctx, id, obj, data, ofs, len, &handle); + int r = aio_put_obj_data(ctx, obj, data, ofs, len, &handle); if (r < 0) return r; return aio_wait(handle); } -int RGWRados::aio_put_obj_data(void *ctx, std::string& id, rgw_obj& obj, +int RGWRados::aio_put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len, void **handle) { @@ -755,7 +747,6 @@ bool RGWRados::aio_completed(void *handle) } /** * Copy an object. - * id: unused (well, it's passed to put_obj) * dest_bucket: the bucket to copy into * dest_obj: the object to copy into * src_bucket: the bucket to copy from @@ -766,7 +757,7 @@ bool RGWRados::aio_completed(void *handle) * err: stores any errors resulting from the get of the original object * Returns: 0 on success, -ERR# otherwise. */ -int RGWRados::copy_obj(void *ctx, std::string& id, +int RGWRados::copy_obj(void *ctx, rgw_obj& dest_obj, rgw_obj& src_obj, time_t *mtime, @@ -812,7 +803,7 @@ int RGWRados::copy_obj(void *ctx, std::string& id, // In the first call to put_obj_data, we pass ofs == -1 so that it will do // a write_full, wiping out whatever was in the object before this - r = put_obj_data(ctx, id, tmp_obj, data, ((ofs == 0) ? -1 : ofs), ret); + r = put_obj_data(ctx, tmp_obj, data, ((ofs == 0) ? -1 : ofs), ret); free(data); if (r < 0) goto done_err; @@ -829,7 +820,7 @@ int RGWRados::copy_obj(void *ctx, std::string& id, if (mtime) obj_stat(ctx, tmp_obj, NULL, mtime, NULL); - r = rgwstore->delete_obj(ctx, id, tmp_obj, false); + r = rgwstore->delete_obj(ctx, tmp_obj, false); if (r < 0) dout(0) << "ERROR: could not remove " << tmp_obj << dendl; @@ -837,18 +828,17 @@ int RGWRados::copy_obj(void *ctx, std::string& id, return ret; done_err: - rgwstore->delete_obj(ctx, id, tmp_obj, false); + rgwstore->delete_obj(ctx, tmp_obj, false); finish_get_obj(&handle); return r; } /** * Delete a bucket. - * id: unused * bucket: the name of the bucket to delete * Returns 0 on success, -ERR# otherwise. */ -int RGWRados::delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool) +int RGWRados::delete_bucket(rgw_bucket& bucket, bool remove_pool) { librados::IoCtx list_ctx; int r = open_bucket_ctx(bucket, list_ctx); @@ -884,7 +874,7 @@ int RGWRados::delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_poo } rgw_obj obj(rgw_root_bucket, bucket.name); - r = delete_obj(NULL, id, obj, true); + r = delete_obj(NULL, obj, true); if (r < 0) return r; @@ -893,11 +883,10 @@ int RGWRados::delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_poo /** * Delete buckets, don't care about content - * id: unused * bucket: the name of the bucket to delete * Returns 0 on success, -ERR# otherwise. */ -int RGWRados::purge_buckets(std::string& id, vector& buckets) +int RGWRados::purge_buckets(vector& buckets) { librados::IoCtx list_ctx; vector::iterator iter; @@ -916,7 +905,7 @@ int RGWRados::purge_buckets(std::string& id, vector& buckets) } rgw_obj obj(rgw_root_bucket, bucket.name); - r = delete_obj(NULL, id, obj, true); + r = delete_obj(NULL, obj, true); if (r < 0) { dout(0) << "WARNING: could not remove bucket object: " << RGW_ROOT_BUCKET << ":" << bucket << dendl; ret = r; @@ -989,12 +978,11 @@ int RGWRados::bucket_suspended(rgw_bucket& bucket, bool *suspended) /** * Delete an object. - * id: unused * bucket: name of the bucket storing the object * obj: name of the object to delete * Returns: 0 on success, -ERR# otherwise. */ -int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool sync) +int RGWRados::delete_obj_impl(void *ctx, rgw_obj& obj, bool sync) { rgw_bucket bucket; std::string oid, key; @@ -1045,11 +1033,11 @@ int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool syn return 0; } -int RGWRados::delete_obj(void *ctx, std::string& id, rgw_obj& obj, bool sync) +int RGWRados::delete_obj(void *ctx, rgw_obj& obj, bool sync) { int r; do { - r = delete_obj_impl(ctx, id, obj, sync); + r = delete_obj_impl(ctx, obj, sync); } while (r == -ECANCELED); return r; } @@ -2360,13 +2348,12 @@ int RGWRados::remove_temp_objects(string date, string time) vector objs; map common_prefixes; string ns; - string id; int max = 1000; bool is_truncated; IntentLogNameFilter filter(date.c_str(), &tm); do { - int r = store->list_objects(id, bucket, max, prefix, delim, marker, + int r = store->list_objects(bucket, max, prefix, delim, marker, objs, common_prefixes, false, ns, &is_truncated, &filter); if (r == -ENOENT) @@ -2404,7 +2391,6 @@ int RGWRados::process_intent_log(rgw_bucket& bucket, string& oid, } bufferlist::iterator iter = bl.begin(); - string id; bool complete = true; try { while (!iter.end()) { @@ -2427,7 +2413,7 @@ int RGWRados::process_intent_log(rgw_bucket& bucket, string& oid, complete = false; break; } - r = rgwstore->delete_obj(NULL, id, entry.obj); + r = rgwstore->delete_obj(NULL, entry.obj); if (r < 0 && r != -ENOENT) { cerr << "failed to remove obj: " << entry.obj << std::endl; complete = false; @@ -2438,7 +2424,7 @@ int RGWRados::process_intent_log(rgw_bucket& bucket, string& oid, complete = false; break; } - r = delete_bucket(id, entry.obj.bucket, true); + r = delete_bucket(entry.obj.bucket, true); if (r < 0 && r != -ENOENT) { cerr << "failed to remove pool: " << entry.obj.bucket.pool << std::endl; complete = false; @@ -2457,7 +2443,7 @@ int RGWRados::process_intent_log(rgw_bucket& bucket, string& oid, rgw_obj obj(bucket, oid); cout << "completed intent log: " << obj << (purge ? ", purging it" : "") << std::endl; if (purge) { - r = delete_obj(NULL, id, obj, true); + r = delete_obj(NULL, obj, true); if (r < 0) cerr << "failed to remove obj: " << obj << std::endl; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 2ae5a5d01d1c6..ee526f154bd55 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -131,7 +131,7 @@ class RGWRados : public RGWAccess bool truncate_dest, bool exclusive, pair *cmp_xattr); - int delete_obj_impl(void *ctx, std::string& id, rgw_obj& src_obj, bool sync); + int delete_obj_impl(void *ctx, rgw_obj& src_obj, bool sync); int select_bucket_placement(std::string& bucket_name, rgw_bucket& bucket); int store_bucket_info(RGWBucketInfo& info); @@ -143,13 +143,13 @@ public: /** Initialize the RADOS instance and prepare to do other ops */ virtual int initialize(CephContext *cct); - /** set up a bucket listing. id is ignored, handle is filled in. */ - virtual int list_buckets_init(std::string& id, RGWAccessHandle *handle); + /** set up a bucket listing. handle is filled in. */ + virtual int list_buckets_init(RGWAccessHandle *handle); /** - * get the next bucket in the listing. id is ignored, obj is filled in, + * get the next bucket in the listing. obj is filled in, * handle is updated. */ - virtual int list_buckets_next(std::string& id, RGWObjEnt& obj, RGWAccessHandle *handle); + virtual int list_buckets_next(RGWObjEnt& obj, RGWAccessHandle *handle); /// list logs int log_list_init(const string& prefix, RGWAccessHandle *handle); @@ -164,7 +164,7 @@ public: /** get listing of the objects in a bucket */ - virtual int list_objects(std::string& id, rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, + virtual int list_objects(rgw_bucket& bucket, int max, std::string& prefix, std::string& delim, std::string& marker, std::vector& result, map& common_prefixes, bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter); @@ -172,20 +172,20 @@ public: * create a bucket with name bucket and the given list of attrs * returns 0 on success, -ERR# otherwise. */ - virtual int create_bucket(std::string& id, rgw_bucket& bucket, + virtual int create_bucket(string& owner, rgw_bucket& bucket, map& attrs, bool system_bucket, bool exclusive = true, uint64_t auid = 0); virtual int add_bucket_placement(std::string& new_pool); - virtual int create_pools(std::string& id, vector& names, vector& retcodes, int auid = 0); + virtual int create_pools(vector& names, vector& retcodes, int auid = 0); /** Write/overwrite an object to the bucket storage. */ - virtual int put_obj_meta(void *ctx, std::string& id, rgw_obj& obj, uint64_t size, time_t *mtime, + virtual int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime, map& attrs, RGWObjCategory category, bool exclusive, map* rmattrs); - virtual int put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + virtual int put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len); - virtual int aio_put_obj_data(void *ctx, std::string& id, rgw_obj& obj, const char *data, + virtual int aio_put_obj_data(void *ctx, rgw_obj& obj, const char *data, off_t ofs, size_t len, void **handle); virtual int aio_wait(void *handle); virtual bool aio_completed(void *handle); @@ -225,7 +225,7 @@ public: } /** Copy an object, with many extra options */ - virtual int copy_obj(void *ctx, std::string& id, rgw_obj& dest_obj, + virtual int copy_obj(void *ctx, rgw_obj& dest_obj, rgw_obj& src_obj, time_t *mtime, const time_t *mod_ptr, @@ -236,14 +236,14 @@ public: RGWObjCategory category, struct rgw_err *err); /** delete a bucket*/ - virtual int delete_bucket(std::string& id, rgw_bucket& bucket, bool remove_pool); - virtual int purge_buckets(std::string& id, vector& buckets); + virtual int delete_bucket(rgw_bucket& bucket, bool remove_pool); + virtual int purge_buckets(vector& buckets); virtual int set_buckets_enabled(std::vector& buckets, bool enabled); virtual int bucket_suspended(rgw_bucket& bucket, bool *suspended); /** Delete an object.*/ - virtual int delete_obj(void *ctx, std::string& id, rgw_obj& src_obj, bool sync); + virtual int delete_obj(void *ctx, rgw_obj& src_obj, bool sync); /** Get the attributes for an object.*/ virtual int get_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& dest); diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index d3627b3b9ecb0..57576abc2b5d5 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -18,12 +18,12 @@ int rgw_put_obj(string& uid, rgw_bucket& bucket, string& oid, const char *data, rgw_obj obj(bucket, oid); - int ret = rgwstore->put_obj(NULL, uid, obj, data, size, NULL, attrs); + int ret = rgwstore->put_obj(NULL, obj, data, size, NULL, attrs); if (ret == -ENOENT) { ret = rgwstore->create_bucket(uid, bucket, attrs, true); //all callers are using system buckets if (ret >= 0) - ret = rgwstore->put_obj(NULL, uid, obj, data, size, NULL, attrs); + ret = rgwstore->put_obj(NULL, obj, data, size, NULL, attrs); } return ret; diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index a7ddf73499c65..b25e89ae65bd2 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -381,7 +381,7 @@ int rgw_remove_user_bucket_info(string user_id, rgw_bucket& bucket, bool purge_d if (ret == 0 && purge_data) { vector buckets_vec; buckets_vec.push_back(bucket); - ret = rgwstore->purge_buckets(user_id, buckets_vec); + ret = rgwstore->purge_buckets(buckets_vec); } @@ -391,28 +391,28 @@ int rgw_remove_user_bucket_info(string user_id, rgw_bucket& bucket, bool purge_d int rgw_remove_key_index(RGWAccessKey& access_key) { rgw_obj obj(ui_key_bucket, access_key.id); - int ret = rgwstore->delete_obj(NULL, access_key.id, obj); + int ret = rgwstore->delete_obj(NULL, obj); return ret; } int rgw_remove_uid_index(string& uid) { rgw_obj obj(ui_uid_bucket, uid); - int ret = rgwstore->delete_obj(NULL, uid, obj); + int ret = rgwstore->delete_obj(NULL, obj); return ret; } -int rgw_remove_email_index(string& uid, string& email) +int rgw_remove_email_index(string& email) { rgw_obj obj(ui_email_bucket, email); - int ret = rgwstore->delete_obj(NULL, uid, obj); + int ret = rgwstore->delete_obj(NULL, obj); return ret; } -int rgw_remove_swift_name_index(string& uid, string& swift_name) +int rgw_remove_swift_name_index(string& swift_name) { rgw_obj obj(ui_swift_bucket, swift_name); - int ret = rgwstore->delete_obj(NULL, uid, obj); + int ret = rgwstore->delete_obj(NULL, obj); return ret; } @@ -448,7 +448,7 @@ int rgw_delete_user(RGWUserInfo& info, bool purge_data) { rgw_obj email_obj(ui_email_bucket, info.user_email); dout(0) << "removing email index: " << info.user_email << dendl; - ret = rgwstore->delete_obj(NULL, info.user_id, email_obj); + ret = rgwstore->delete_obj(NULL, email_obj); if (ret < 0 && ret != -ENOENT) { dout(0) << "ERROR: could not remove " << info.user_id << ":" << email_obj << ", should be fixed (err=" << ret << ")" << dendl; return ret; @@ -456,7 +456,7 @@ int rgw_delete_user(RGWUserInfo& info, bool purge_data) { if (purge_data) { dout(0) << "purging user buckets" << dendl; - ret = rgwstore->purge_buckets(info.user_id, buckets_vec); + ret = rgwstore->purge_buckets(buckets_vec); if (ret < 0 && ret != -ENOENT) { dout(0) << "ERROR: delete_buckets returned " << ret << dendl; return ret; @@ -467,7 +467,7 @@ int rgw_delete_user(RGWUserInfo& info, bool purge_data) { get_buckets_obj(info.user_id, buckets_obj_id); rgw_obj uid_bucks(ui_uid_bucket, buckets_obj_id); dout(0) << "removing user buckets index" << dendl; - ret = rgwstore->delete_obj(NULL, info.user_id, uid_bucks); + ret = rgwstore->delete_obj(NULL, uid_bucks); if (ret < 0 && ret != -ENOENT) { dout(0) << "ERROR: could not remove " << info.user_id << ":" << uid_bucks << ", should be fixed (err=" << ret << ")" << dendl; return ret; @@ -475,7 +475,7 @@ int rgw_delete_user(RGWUserInfo& info, bool purge_data) { rgw_obj uid_obj(ui_uid_bucket, info.user_id); dout(0) << "removing user index: " << info.user_id << dendl; - ret = rgwstore->delete_obj(NULL, info.user_id, uid_obj); + ret = rgwstore->delete_obj(NULL, uid_obj); if (ret < 0 && ret != -ENOENT) { dout(0) << "ERROR: could not remove " << info.user_id << ":" << uid_obj << ", should be fixed (err=" << ret << ")" << dendl; return ret; diff --git a/src/rgw/rgw_user.h b/src/rgw/rgw_user.h index 0d6e713f74446..8ce3c2454b776 100644 --- a/src/rgw/rgw_user.h +++ b/src/rgw/rgw_user.h @@ -144,6 +144,6 @@ extern int rgw_remove_user_bucket_info(string user_id, rgw_bucket& bucket, bool */ extern int rgw_remove_key_index(RGWAccessKey& access_key); extern int rgw_remove_uid_index(string& uid); -extern int rgw_remove_email_index(string& uid, string& email); -extern int rgw_remove_swift_name_index(string& uid, string& swift_name); +extern int rgw_remove_email_index(string& email); +extern int rgw_remove_swift_name_index(string& swift_name); #endif -- 2.39.5