]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/ObjectStore: deprecated collection attr operations
authorSage Weil <sage@redhat.com>
Fri, 5 Dec 2014 21:38:10 +0000 (13:38 -0800)
committerSage Weil <sage@redhat.com>
Wed, 17 Dec 2014 01:07:58 +0000 (17:07 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/ObjectStore.h
src/os/Transaction.cc
src/osd/PG.cc
src/tools/ceph_objectstore_tool.cc

index efbdc897a592f645005e57241d8c566e12b80005..4feb19061c662bda9e4dc24f9af889ceff4efc18 100644 (file)
@@ -896,13 +896,12 @@ public:
       ops++;
     }
 
+    // NOTE: Collection attr operations are all DEPRECATED.  new
+    // backends need not implement these at all.
+
     /// Set an xattr on a collection
-    void collection_setattr(coll_t cid, const char* name, bufferlist& val) {
-      string n(name);
-      collection_setattr(cid, n, val);
-    }
-    /// Set an xattr on a collection
-    void collection_setattr(coll_t cid, const string& name, bufferlist& val) {
+    void collection_setattr(coll_t cid, const string& name, bufferlist& val)
+      __attribute__ ((deprecated)) {
       __u32 op = OP_COLL_SETATTR;
       ::encode(op, tbl);
       ::encode(cid, tbl);
@@ -912,12 +911,8 @@ public:
     }
 
     /// Remove an xattr from a collection
-    void collection_rmattr(coll_t cid, const char* name) {
-      string n(name);
-      collection_rmattr(cid, n);
-    }
-    /// Remove an xattr from a collection
-    void collection_rmattr(coll_t cid, const string& name) {
+    void collection_rmattr(coll_t cid, const string& name)
+      __attribute__ ((deprecated)) {
       __u32 op = OP_COLL_RMATTR;
       ::encode(op, tbl);
       ::encode(cid, tbl);
@@ -925,7 +920,8 @@ public:
       ops++;
     }
     /// Set multiple xattrs on a collection
-    void collection_setattrs(coll_t cid, map<string,bufferptr>& aset) {
+    void collection_setattrs(coll_t cid, map<string,bufferptr>& aset)
+      __attribute__ ((deprecated)) {
       __u32 op = OP_COLL_SETATTRS;
       ::encode(op, tbl);
       ::encode(cid, tbl);
@@ -933,7 +929,8 @@ public:
       ops++;
     }
     /// Set multiple xattrs on a collection
-    void collection_setattrs(coll_t cid, map<string,bufferlist>& aset) {
+    void collection_setattrs(coll_t cid, map<string,bufferlist>& aset)
+      __attribute__ ((deprecated)) {
       __u32 op = OP_COLL_SETATTRS;
       ::encode(op, tbl);
       ::encode(cid, tbl);
index 674eef43cd0ee4cfea51e2c96502804f94e086b1..c193c46cae41734d8b186e3d1daabb9c985c19db 100644 (file)
@@ -443,6 +443,9 @@ void ObjectStore::Transaction::dump(ceph::Formatter *f)
   f->close_section();
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 void ObjectStore::Transaction::generate_test_instances(list<ObjectStore::Transaction*>& o)
 {
   o.push_back(new Transaction);
@@ -482,8 +485,10 @@ void ObjectStore::Transaction::generate_test_instances(list<ObjectStore::Transac
   t->create_collection(c);
   t->collection_move(c, c2, o3);
   t->remove_collection(c);
-  t->collection_setattr(c, "this", bl);
-  t->collection_rmattr(c, "foo");
+  t->collection_setattr(c, string("this"), bl);
+  t->collection_rmattr(c, string("foo"));
   t->collection_setattrs(c, m);
   o.push_back(t);  
 }
+
+#pragma GCC diagnostic pop
index 6add593c963285d90962c99c9e15ed304c08404e..d9fe3abe86cdf60b164fa44c816dbca3310b0e6e 100644 (file)
@@ -2468,6 +2468,9 @@ void PG::init(
   write_if_dirty(*t);
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
 {
   assert(info_struct_v <= 8);
@@ -2504,6 +2507,8 @@ void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
   assert(r == 0);
 }
 
+#pragma GCC diagnostic pop
+
 void PG::_upgrade_v7(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
 {
   unsigned removed = 0;
index 50a87a62a4d8767174811a35ac7e91b02e1e4ac9..839e341f819519ed3bf6c9de5487503dc7fdc8a3 100644 (file)
@@ -707,6 +707,9 @@ int finish_remove_pgs(ObjectStore *store)
   return 0;
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 int mark_pg_for_removal(ObjectStore *fs, spg_t pgid, ObjectStore::Transaction *t)
 {
   pg_info_t info(pgid);
@@ -742,6 +745,8 @@ int mark_pg_for_removal(ObjectStore *fs, spg_t pgid, ObjectStore::Transaction *t
   return 0;
 }
 
+#pragma GCC diagnostic pop
+
 int initiate_new_remove_pg(ObjectStore *store, spg_t r_pgid)
 {
   if (!store->collection_exists(coll_t(r_pgid)))