From: Sage Weil Date: Fri, 5 Dec 2014 21:38:10 +0000 (-0800) Subject: os/ObjectStore: deprecated collection attr operations X-Git-Tag: v0.91~23^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a1a3e156b60f16c304721248066c12a019c80b65;p=ceph.git os/ObjectStore: deprecated collection attr operations Signed-off-by: Sage Weil --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index efbdc897a592f..4feb19061c662 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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& aset) { + void collection_setattrs(coll_t cid, map& 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& aset) { + void collection_setattrs(coll_t cid, map& aset) + __attribute__ ((deprecated)) { __u32 op = OP_COLL_SETATTRS; ::encode(op, tbl); ::encode(cid, tbl); diff --git a/src/os/Transaction.cc b/src/os/Transaction.cc index 674eef43cd0ee..c193c46cae417 100644 --- a/src/os/Transaction.cc +++ b/src/os/Transaction.cc @@ -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& o) { o.push_back(new Transaction); @@ -482,8 +485,10 @@ void ObjectStore::Transaction::generate_test_instances(listcreate_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 diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6add593c96328..d9fe3abe86cdf 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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 &snapcolls) { assert(info_struct_v <= 8); @@ -2504,6 +2507,8 @@ void PG::upgrade(ObjectStore *store, const interval_set &snapcolls) assert(r == 0); } +#pragma GCC diagnostic pop + void PG::_upgrade_v7(ObjectStore *store, const interval_set &snapcolls) { unsigned removed = 0; diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 50a87a62a4d87..839e341f81951 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -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)))