summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-03-05 22:00:43 -0800
committerYehuda Sadeh <yehuda@inktank.com>2013-04-15 14:23:12 -0700
commitab98a7d561f4465a4a2e38cb24d3b0b5c2849a53 (patch)
tree1db7dd136862a51f06651ed28cf459bc0c226e7a
parent9d99d4b0b71ff7ec6a316b0c93cc20c5b936487d (diff)
downloadceph-ab98a7d561f4465a4a2e38cb24d3b0b5c2849a53.tar.gz
rgw: user metadata updates also key version
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rados.cc12
-rw-r--r--src/rgw/rgw_swift.cc2
-rw-r--r--src/rgw/rgw_tools.cc7
-rw-r--r--src/rgw/rgw_tools.h2
-rw-r--r--src/rgw/rgw_user.cc17
-rw-r--r--src/rgw/rgw_user.h2
6 files changed, 21 insertions, 21 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc
index ef5a672dc41..fe66c9f3b6d 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -130,7 +130,7 @@ int RGWRegion::set_as_default()
::encode(default_info, bl);
- int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL);
+ int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL, NULL);
if (ret < 0)
return ret;
@@ -230,7 +230,7 @@ int RGWRegion::store_info(bool exclusive)
bufferlist bl;
::encode(*this, bl);
- int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL);
+ int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, NULL);
return ret;
}
@@ -309,7 +309,7 @@ int RGWZoneParams::store_info(CephContext *cct, RGWRados *store, RGWRegion& regi
bufferlist bl;
::encode(*this, bl);
- int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL);
+ int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL, NULL);
return ret;
}
@@ -385,7 +385,7 @@ int RGWRegionMap::store(CephContext *cct, RGWRados *store)
bufferlist bl;
::encode(*this, bl);
- int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL);
+ int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL, NULL);
return ret;
}
@@ -1205,7 +1205,7 @@ int RGWRados::store_bucket_info(RGWBucketInfo& info, map<string, bufferlist> *pa
bufferlist bl;
::encode(info, bl);
- int ret = rgw_put_system_obj(this, zone.domain_root, info.bucket.name, bl.c_str(), bl.length(), exclusive, pattrs);
+ int ret = rgw_put_system_obj(this, zone.domain_root, info.bucket.name, bl.c_str(), bl.length(), exclusive, NULL, pattrs);
if (ret < 0)
return ret;
@@ -3649,7 +3649,7 @@ int RGWRados::put_bucket_info(string& bucket_name, RGWBucketInfo& info, bool exc
::encode(info, bl);
- int ret = rgw_put_system_obj(this, zone.domain_root, bucket_name, bl.c_str(), bl.length(), exclusive, pattrs);
+ int ret = rgw_put_system_obj(this, zone.domain_root, bucket_name, bl.c_str(), bl.length(), exclusive, NULL, pattrs);
return ret;
}
diff --git a/src/rgw/rgw_swift.cc b/src/rgw/rgw_swift.cc
index 59117dc876a..9b9b1bbefb1 100644
--- a/src/rgw/rgw_swift.cc
+++ b/src/rgw/rgw_swift.cc
@@ -511,7 +511,7 @@ int RGWSwift::update_user_info(RGWRados *store, struct rgw_swift_auth_info *info
user_info.user_id = info->user;
user_info.display_name = info->display_name;
- int ret = rgw_store_user_info(store, user_info, NULL, true);
+ int ret = rgw_store_user_info(store, user_info, NULL, NULL, true);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed to store new user's info: ret=" << ret << dendl;
return ret;
diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc
index a8c4fed225b..b36c182c2e4 100644
--- a/src/rgw/rgw_tools.cc
+++ b/src/rgw/rgw_tools.cc
@@ -14,7 +14,8 @@
static map<string, string> ext_mime_map;
-int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, const char *data, size_t size, bool exclusive, map<string, bufferlist> *pattrs)
+int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, const char *data, size_t size, bool exclusive,
+ obj_version *objv, map<string, bufferlist> *pattrs)
{
map<string,bufferlist> no_attrs;
if (!pattrs)
@@ -22,12 +23,12 @@ int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, cons
rgw_obj obj(bucket, oid);
- int ret = rgwstore->put_system_obj(NULL, obj, data, size, exclusive, NULL, *pattrs, NULL);
+ int ret = rgwstore->put_system_obj(NULL, obj, data, size, exclusive, NULL, *pattrs, objv);
if (ret == -ENOENT) {
ret = rgwstore->create_pool(bucket);
if (ret >= 0)
- ret = rgwstore->put_system_obj(NULL, obj, data, size, exclusive, NULL, *pattrs, NULL);
+ ret = rgwstore->put_system_obj(NULL, obj, data, size, exclusive, NULL, *pattrs, objv);
}
return ret;
diff --git a/src/rgw/rgw_tools.h b/src/rgw/rgw_tools.h
index 442c2cc8788..01b5b1bbcd2 100644
--- a/src/rgw/rgw_tools.h
+++ b/src/rgw/rgw_tools.h
@@ -10,7 +10,7 @@ class RGWRados;
struct obj_version;
-int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, const char *data, size_t size, bool exclusive, map<string, bufferlist> *pattrs = NULL);
+int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, const char *data, size_t size, bool exclusive, obj_version *objv, map<string, bufferlist> *pattrs = NULL);
int rgw_get_system_obj(RGWRados *rgwstore, void *ctx, rgw_bucket& bucket, string& key, bufferlist& bl, obj_version *objv, map<string, bufferlist> *pattrs = NULL);
int rgw_tools_init(CephContext *cct);
diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc
index 2c8042b4c9d..684b1a4ca5b 100644
--- a/src/rgw/rgw_user.cc
+++ b/src/rgw/rgw_user.cc
@@ -42,7 +42,7 @@ bool rgw_user_is_authenticated(RGWUserInfo& info)
* Save the given user information to storage.
* Returns: 0 on success, -ERR# on failure.
*/
-int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_info, bool exclusive)
+int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_info, obj_version *objv, bool exclusive)
{
bufferlist bl;
info.encode(bl);
@@ -88,14 +88,14 @@ int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_inf
::encode(ui, data_bl);
::encode(info, data_bl);
- ret = rgw_put_system_obj(store, store->zone.user_uid_pool, info.user_id, data_bl.c_str(), data_bl.length(), exclusive);
+ ret = rgw_put_system_obj(store, store->zone.user_uid_pool, info.user_id, data_bl.c_str(), data_bl.length(), exclusive, objv);
if (ret < 0)
return ret;
if (!info.user_email.empty()) {
if (!old_info ||
old_info->user_email.compare(info.user_email) != 0) { /* only if new index changed */
- ret = rgw_put_system_obj(store, store->zone.user_email_pool, info.user_email, link_bl.c_str(), link_bl.length(), exclusive);
+ ret = rgw_put_system_obj(store, store->zone.user_email_pool, info.user_email, link_bl.c_str(), link_bl.length(), exclusive, objv);
if (ret < 0)
return ret;
}
@@ -108,7 +108,7 @@ int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_inf
if (old_info && old_info->access_keys.count(iter->first) != 0)
continue;
- ret = rgw_put_system_obj(store, store->zone.user_keys_pool, k.id, link_bl.c_str(), link_bl.length(), exclusive);
+ ret = rgw_put_system_obj(store, store->zone.user_keys_pool, k.id, link_bl.c_str(), link_bl.length(), exclusive, objv);
if (ret < 0)
return ret;
}
@@ -120,7 +120,7 @@ int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_inf
if (old_info && old_info->swift_keys.count(siter->first) != 0)
continue;
- ret = rgw_put_system_obj(store, store->zone.user_swift_pool, k.id, link_bl.c_str(), link_bl.length(), exclusive);
+ ret = rgw_put_system_obj(store, store->zone.user_swift_pool, k.id, link_bl.c_str(), link_bl.length(), exclusive, objv);
if (ret < 0)
return ret;
}
@@ -446,7 +446,6 @@ static bool remove_old_indexes(RGWRados *store,
* formatter is flushed at the correct time.
*/
-
static void dump_subusers_info(Formatter *f, RGWUserInfo &info)
{
map<string, RGWSubUser>::iterator uiter;
@@ -1526,7 +1525,7 @@ int RGWUser::update(RGWUserAdminOpState& op_state, std::string *err_msg)
}
if (is_populated()) {
- ret = rgw_store_user_info(store, user_info, &old_info, false);
+ ret = rgw_store_user_info(store, user_info, &old_info, NULL, false);
if (ret < 0) {
set_err_msg(err_msg, "unable to store user info");
return ret;
@@ -1538,7 +1537,7 @@ int RGWUser::update(RGWUserAdminOpState& op_state, std::string *err_msg)
return ret;
}
} else {
- ret = rgw_store_user_info(store, user_info, NULL, false);
+ ret = rgw_store_user_info(store, user_info, NULL, NULL, false);
if (ret < 0) {
set_err_msg(err_msg, "unable to store user info");
return ret;
@@ -2231,7 +2230,7 @@ public:
return ret;
- ret = rgw_store_user_info(store, info, &old_info, false);
+ ret = rgw_store_user_info(store, info, &old_info, &objv, false);
if (ret < 0)
return ret;
diff --git a/src/rgw/rgw_user.h b/src/rgw/rgw_user.h
index 14a7c1d8cbd..1aa09e73bb7 100644
--- a/src/rgw/rgw_user.h
+++ b/src/rgw/rgw_user.h
@@ -51,7 +51,7 @@ extern bool rgw_user_is_authenticated(RGWUserInfo& info);
* Save the given user information to storage.
* Returns: 0 on success, -ERR# on failure.
*/
-extern int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_info, bool exclusive);
+extern int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_info, obj_version *objv, bool exclusive);
/**
* Given an email, finds the user info associated with it.
* returns: 0 on success, -ERR# on failure (including nonexistence)