]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: CLEANUP: Change getattr_maybe_cache() to reflect how it is being used 17703/head
authorDavid Zafman <dzafman@redhat.com>
Tue, 12 Sep 2017 22:09:14 +0000 (15:09 -0700)
committerDavid Zafman <dzafman@redhat.com>
Wed, 13 Sep 2017 20:16:12 +0000 (13:16 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index b91cd4980beeaec8d69a7bc1d381fc112a47c072..3791fa6421123f80b18cce73a19a7075e3b3ff01 100644 (file)
@@ -5339,8 +5339,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        map<string, bufferlist> out;
        result = getattrs_maybe_cache(
          ctx->obc,
-         &out,
-         true);
+         &out);
         
         bufferlist bl;
         ::encode(out, bl);
@@ -6103,8 +6102,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        /* rm_attrs */
        map<string,bufferlist> rmattrs;
        result = getattrs_maybe_cache(ctx->obc,
-                   &rmattrs,
-                   true);
+                   &rmattrs);
        if (result < 0) {
          return result;
        }
@@ -7760,8 +7758,7 @@ int PrimaryLogPG::do_copy_get(OpContext *ctx, bufferlist::iterator& bp,
   if (!cursor.attr_complete) {
     result = getattrs_maybe_cache(
       ctx->obc,
-      &out_attrs,
-      true);
+      &out_attrs);
     if (result < 0) {
       if (cb) {
         delete cb;
@@ -14405,26 +14402,23 @@ int PrimaryLogPG::getattr_maybe_cache(
 
 int PrimaryLogPG::getattrs_maybe_cache(
   ObjectContextRef obc,
-  map<string, bufferlist> *out,
-  bool user_only)
+  map<string, bufferlist> *out)
 {
   int r = 0;
+  assert(out);
   if (pool.info.require_rollback()) {
-    if (out)
-      *out = obc->attr_cache;
+    *out = obc->attr_cache;
   } else {
     r = pgbackend->objects_get_attrs(obc->obs.oi.soid, out);
   }
-  if (out && user_only) {
-    map<string, bufferlist> tmp;
-    for (map<string, bufferlist>::iterator i = out->begin();
-        i != out->end();
-        ++i) {
-      if (i->first.size() > 1 && i->first[0] == '_')
-       tmp[i->first.substr(1, i->first.size())].claim(i->second);
-    }
-    tmp.swap(*out);
+  map<string, bufferlist> tmp;
+  for (map<string, bufferlist>::iterator i = out->begin();
+       i != out->end();
+       ++i) {
+    if (i->first.size() > 1 && i->first[0] == '_')
+      tmp[i->first.substr(1, i->first.size())].claim(i->second);
   }
+  tmp.swap(*out);
   return r;
 }
 
index bc4279b142333f525b46bf3c8ea4608249b0f95e..18cfb49a41062595dc71156287d7400c27bc5bca 100644 (file)
@@ -1799,8 +1799,7 @@ public:
     bufferlist *val);
   int getattrs_maybe_cache(
     ObjectContextRef obc,
-    map<string, bufferlist> *out,
-    bool user_only = false);
+    map<string, bufferlist> *out);
 };
 
 inline ostream& operator<<(ostream& out, const PrimaryLogPG::RepGather& repop)