]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectStore: add a bufferlist-based getattrs() function
authorGreg Farnum <greg@inktank.com>
Thu, 17 Oct 2013 22:14:40 +0000 (15:14 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 25 Oct 2013 20:36:44 +0000 (13:36 -0700)
Signed-off-by: Greg Farnum <greg@inktank.com>
src/os/ObjectStore.h

index baa35aa7e831e2485a80362123a04eb9e15e53f8..6494290b54112d130be64ca55e98400db1e87c56 100644 (file)
@@ -905,6 +905,16 @@ public:
     return r;
   }
   virtual int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset, bool user_only = false) {return 0;};
+  int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferlist>& aset, bool user_only = false) {
+    map<string,bufferptr> bmap;
+    int r = getattrs(cid, oid, bmap, user_only);
+    for (map<string,bufferptr>::iterator i = bmap.begin();
+       i != bmap.end();
+       ++i) {
+      aset[i->first].append(i->second);
+    }
+    return r;
+  }
 
    
   // collections