]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: implement collection_bits
authorSage Weil <sage@redhat.com>
Thu, 7 Jan 2016 02:34:18 +0000 (21:34 -0500)
committerSage Weil <sage@redhat.com>
Wed, 27 Jan 2016 19:06:13 +0000 (14:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index f1720810bda206074a79149138217f5d852d7150..667f4d549cc78cf91b39974a9cf488ca02a6fb1e 100644 (file)
@@ -2739,6 +2739,17 @@ bool BlueStore::collection_empty(coll_t cid)
   return empty;
 }
 
+int BlueStore::collection_bits(coll_t cid)
+{
+  dout(15) << __func__ << " " << cid << dendl;
+  CollectionRef c = _get_collection(cid);
+  if (!c)
+    return -ENOENT;
+  RWLock::RLocker l(c->lock);
+  dout(10) << __func__ << " " << cid << " = " << c->cnode.bits << dendl;
+  return c->cnode.bits;
+}
+
 int BlueStore::collection_list(
   coll_t cid, ghobject_t start, ghobject_t end,
   bool sort_bitwise, int max,
index 08d77cdc00f6ea898908a6615743edd11260eb07..0e5424dd6de6d71c580385a7f2c883bb6a9606bb 100644 (file)
@@ -642,6 +642,7 @@ public:
   int list_collections(vector<coll_t>& ls);
   bool collection_exists(coll_t c);
   bool collection_empty(coll_t c);
+  int collection_bits(coll_t c);
 
   int collection_list(coll_t cid, ghobject_t start, ghobject_t end,
                      bool sort_bitwise, int max,