]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: improve const-correctness of rgw_get_user_info_by_swift().
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 4 Apr 2016 12:56:36 +0000 (14:56 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Jun 2016 13:12:10 +0000 (15:12 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_user.cc
src/rgw/rgw_user.h

index 361a8c8193adbc9f8746d03217f15218919f9163..1f93aa3d789b8c2b0904faba7363048cc28031c5 100644 (file)
@@ -215,8 +215,12 @@ struct user_info_entry {
 
 static RGWChainedCacheImpl<user_info_entry> uinfo_cache;
 
-int rgw_get_user_info_from_index(RGWRados *store, string& key, rgw_bucket& bucket, RGWUserInfo& info,
-                                 RGWObjVersionTracker *objv_tracker, real_time *pmtime)
+int rgw_get_user_info_from_index(RGWRados * const store,
+                                 const string& key,
+                                 rgw_bucket& bucket,
+                                 RGWUserInfo& info,
+                                 RGWObjVersionTracker * const objv_tracker,
+                                 real_time * const pmtime)
 {
   user_info_entry e;
   if (uinfo_cache.find(key, &e)) {
@@ -318,10 +322,15 @@ int rgw_get_user_info_by_email(RGWRados *store, string& email, RGWUserInfo& info
  * Given an swift username, finds the user_info associated with it.
  * returns: 0 on success, -ERR# on failure (including nonexistence)
  */
-extern int rgw_get_user_info_by_swift(RGWRados *store, string& swift_name, RGWUserInfo& info,
-                                      RGWObjVersionTracker *objv_tracker, real_time *pmtime)
-{
-  return rgw_get_user_info_from_index(store, swift_name, store->get_zone_params().user_swift_pool, info, objv_tracker, pmtime);
+extern int rgw_get_user_info_by_swift(RGWRados * const store,
+                                      const string& swift_name,
+                                      RGWUserInfo& info,        /* out */
+                                      RGWObjVersionTracker * const objv_tracker,
+                                      real_time * const pmtime)
+{
+  return rgw_get_user_info_from_index(store, swift_name,
+                                      store->get_zone_params().user_swift_pool,
+                                      info, objv_tracker, pmtime);
 }
 
 /**
index 4ede53c677b1717b7a7aa993e8d4ca2f192e4ddd..f3d0bce761a9d25abc514abc602fcf3116ff5c48 100644 (file)
@@ -92,8 +92,11 @@ extern int rgw_get_user_info_by_email(RGWRados *store, string& email, RGWUserInf
  * Given an swift username, finds the user info associated with it.
  * returns: 0 on success, -ERR# on failure (including nonexistence)
  */
-extern int rgw_get_user_info_by_swift(RGWRados *store, string& swift_name, RGWUserInfo& info,
-                                      RGWObjVersionTracker *objv_tracker = NULL, real_time *pmtime = NULL);
+extern int rgw_get_user_info_by_swift(RGWRados *store,
+                                      const string& swift_name,
+                                      RGWUserInfo& info,        /* out */
+                                      RGWObjVersionTracker *objv_tracker = nullptr,
+                                      real_time *pmtime = nullptr);
 /**
  * Given an access key, finds the user info associated with it.
  * returns: 0 on success, -ERR# on failure (including nonexistence)