]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/MemStore: drop support for collection attrs
authorSage Weil <sage@redhat.com>
Fri, 5 Dec 2014 21:59:18 +0000 (13:59 -0800)
committerSage Weil <sage@redhat.com>
Wed, 17 Dec 2014 01:07:59 +0000 (17:07 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/MemStore.cc
src/os/MemStore.h

index 8eb0bcb5fcc912828d2b71ed54bba0fce56d7284..427793e4b540c95629620aa1c0048c9a8cfd1974 100644 (file)
@@ -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<string,bufferptr> &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<coll_t,CollectionRef>::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<string,bufferptr> &aset)
-{
-  dout(10) << __func__ << " " << cid << dendl;
-  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
-  if (cp == coll_map.end())
-    return -ENOENT;
-  RWLock::WLocker l(cp->second->lock);
-
-  for (map<string,bufferptr>::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<coll_t,CollectionRef>::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)
 {
index 83d776297b3904b43e7d0f4dbf08fecdebd28369..5bbe9c96eb31949ff48fe324d67bd457bf16b444 100644 (file)
@@ -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<string,bufferptr> &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<coll_t>& 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<string,bufferptr> &aset);
   bool collection_empty(coll_t c);
   int collection_list(coll_t cid, vector<ghobject_t>& o);
   int collection_list_partial(coll_t cid, ghobject_t start,