os/bluestore: implement collection_bits

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-01-06 21:34:18 -05:00
parent 17d3c9f43f
commit 27dc220abd
2 changed files with 12 additions and 0 deletions

View 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,

View 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,