From: Sage Weil Date: Fri, 5 Dec 2014 21:59:18 +0000 (-0800) Subject: os/MemStore: drop support for collection attrs X-Git-Tag: v0.91~23^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43f0bcb19f82676ea7217f8dbd9f4477e4eb3578;p=ceph.git os/MemStore: drop support for collection attrs Signed-off-by: Sage Weil --- diff --git a/src/os/MemStore.cc b/src/os/MemStore.cc index 8eb0bcb5fcc9..427793e4b540 100644 --- a/src/os/MemStore.cc +++ b/src/os/MemStore.cc @@ -406,51 +406,6 @@ bool MemStore::collection_exists(coll_t cid) return coll_map.count(cid); } -int MemStore::collection_getattr(coll_t cid, const char *name, - void *value, size_t size) -{ - dout(10) << __func__ << " " << cid << " " << name << dendl; - CollectionRef c = get_collection(cid); - if (!c) - return -ENOENT; - RWLock::RLocker lc(c->lock); - - if (!c->xattr.count(name)) - return -ENODATA; - bufferlist bl; - bl.append(c->xattr[name]); - size_t l = MIN(size, bl.length()); - bl.copy(0, size, (char *)value); - return l; -} - -int MemStore::collection_getattr(coll_t cid, const char *name, bufferlist& bl) -{ - dout(10) << __func__ << " " << cid << " " << name << dendl; - CollectionRef c = get_collection(cid); - if (!c) - return -ENOENT; - RWLock::RLocker l(c->lock); - - if (!c->xattr.count(name)) - return -ENODATA; - bl.clear(); - bl.append(c->xattr[name]); - return bl.length(); -} - -int MemStore::collection_getattrs(coll_t cid, map &aset) -{ - dout(10) << __func__ << " " << cid << dendl; - CollectionRef c = get_collection(cid); - if (!c) - return -ENOENT; - RWLock::RLocker l(c->lock); - - aset = c->xattr; - return 0; -} - bool MemStore::collection_empty(coll_t cid) { dout(10) << __func__ << " " << cid << dendl; @@ -896,7 +851,7 @@ void MemStore::_do_transaction(Transaction& t) string name = i.decode_attrname(); bufferlist bl; i.decode_bl(bl); - r = _collection_setattr(cid, name.c_str(), bl.c_str(), bl.length()); + assert(0 == "not implemented"); } break; @@ -904,7 +859,7 @@ void MemStore::_do_transaction(Transaction& t) { coll_t cid = i.decode_cid(); string name = i.decode_attrname(); - r = _collection_rmattr(cid, name.c_str()); + assert(0 == "not implemented"); } break; @@ -1443,49 +1398,6 @@ int MemStore::_collection_move_rename(coll_t oldcid, const ghobject_t& oldoid, return r; } -int MemStore::_collection_setattr(coll_t cid, const char *name, - const void *value, size_t size) -{ - dout(10) << __func__ << " " << cid << " " << name << dendl; - ceph::unordered_map::iterator cp = coll_map.find(cid); - if (cp == coll_map.end()) - return -ENOENT; - RWLock::WLocker l(cp->second->lock); - - cp->second->xattr[name] = bufferptr((const char *)value, size); - return 0; -} - -int MemStore::_collection_setattrs(coll_t cid, map &aset) -{ - dout(10) << __func__ << " " << cid << dendl; - ceph::unordered_map::iterator cp = coll_map.find(cid); - if (cp == coll_map.end()) - return -ENOENT; - RWLock::WLocker l(cp->second->lock); - - for (map::const_iterator p = aset.begin(); - p != aset.end(); - ++p) { - cp->second->xattr[p->first] = p->second; - } - return 0; -} - -int MemStore::_collection_rmattr(coll_t cid, const char *name) -{ - dout(10) << __func__ << " " << cid << " " << name << dendl; - ceph::unordered_map::iterator cp = coll_map.find(cid); - if (cp == coll_map.end()) - return -ENOENT; - RWLock::WLocker l(cp->second->lock); - - if (cp->second->xattr.count(name) == 0) - return -ENODATA; - cp->second->xattr.erase(name); - return 0; -} - int MemStore::_split_collection(coll_t cid, uint32_t bits, uint32_t match, coll_t dest) { diff --git a/src/os/MemStore.h b/src/os/MemStore.h index 83d776297b39..5bbe9c96eb31 100644 --- a/src/os/MemStore.h +++ b/src/os/MemStore.h @@ -214,10 +214,6 @@ private: int _collection_add(coll_t cid, coll_t ocid, const ghobject_t& oid); int _collection_move_rename(coll_t oldcid, const ghobject_t& oldoid, coll_t cid, const ghobject_t& o); - int _collection_setattr(coll_t cid, const char *name, const void *value, - size_t size); - int _collection_setattrs(coll_t cid, map &aset); - int _collection_rmattr(coll_t cid, const char *name); int _split_collection(coll_t cid, uint32_t bits, uint32_t rem, coll_t dest); int _save(); @@ -287,10 +283,6 @@ public: int list_collections(vector& ls); bool collection_exists(coll_t c); - int collection_getattr(coll_t cid, const char *name, - void *value, size_t size); - int collection_getattr(coll_t cid, const char *name, bufferlist& bl); - int collection_getattrs(coll_t cid, map &aset); bool collection_empty(coll_t c); int collection_list(coll_t cid, vector& o); int collection_list_partial(coll_t cid, ghobject_t start,