]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rbd: removed unused snapshot feature bitmask
authorJason Dillaman <dillaman@redhat.com>
Tue, 16 Jan 2018 19:57:34 +0000 (14:57 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 26 Jan 2018 15:32:40 +0000 (10:32 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/cls/rbd/cls_rbd.cc
src/cls/rbd/cls_rbd.h

index f5b7050b25c692ba6d1a114a47f632b023569a2f..a595a773b142befed76740cb6916c65f747d650b 100644 (file)
@@ -273,11 +273,11 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
  */
 int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  uint64_t snap_id;
   bool read_only = false;
 
   bufferlist::iterator iter = in->begin();
   try {
+    uint64_t snap_id;
     decode(snap_id, iter);
     if (!iter.end()) {
       decode(read_only, iter);
@@ -286,21 +286,7 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     return -EINVAL;
   }
 
-  CLS_LOG(20, "get_features snap_id=%" PRIu64 ", read_only=%d",
-          snap_id, read_only);
-
-  // NOTE: keep this deprecated snapshot logic to support negative
-  // test cases in older (pre-Infernalis) releases. Remove once older
-  // releases are no longer supported.
-  if (snap_id != CEPH_NOSNAP) {
-    cls_rbd_snap snap;
-    string snapshot_key;
-    key_from_snap_id(snap_id, &snapshot_key);
-    int r = read_key(hctx, snapshot_key, &snap);
-    if (r < 0) {
-      return r;
-    }
-  }
+  CLS_LOG(20, "get_features read_only=%d", read_only);
 
   uint64_t features;
   int r = read_key(hctx, "features", &features);
@@ -1720,11 +1706,6 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     CLS_ERR("Could not read image's size off disk: %s", cpp_strerror(r).c_str());
     return r;
   }
-  r = read_key(hctx, "features", &snap_meta.features);
-  if (r < 0) {
-    CLS_ERR("Could not read image's features off disk: %s", cpp_strerror(r).c_str());
-    return r;
-  }
   r = read_key(hctx, "flags", &snap_meta.flags);
   if (r < 0 && r != -ENOENT) {
     CLS_ERR("Could not read image's flags off disk: %s", cpp_strerror(r).c_str());
index c340d3ce9ecf6e2193c8403c4300aa5efe3eb332..690641f05654b7ab7723faee4b5a46fc9ea9448a 100644 (file)
@@ -62,7 +62,6 @@ struct cls_rbd_snap {
   snapid_t id;
   string name;
   uint64_t image_size;
-  uint64_t features;
   uint8_t protection_status;
   cls_rbd_parent parent;
   uint64_t flags;
@@ -75,7 +74,7 @@ struct cls_rbd_snap {
     return parent.exists();
   }
 
-  cls_rbd_snap() : id(CEPH_NOSNAP), image_size(0), features(0),
+  cls_rbd_snap() : id(CEPH_NOSNAP), image_size(0),
                   protection_status(RBD_PROTECTION_STATUS_UNPROTECTED),
                    flags(0), timestamp(utime_t())
     {}
@@ -84,7 +83,8 @@ struct cls_rbd_snap {
     encode(id, bl);
     encode(name, bl);
     encode(image_size, bl);
-    encode(features, bl);
+    uint64_t features = 0;
+    encode(features, bl); // unused -- preserve ABI
     encode(parent, bl);
     encode(protection_status, bl);
     encode(flags, bl);
@@ -97,7 +97,8 @@ struct cls_rbd_snap {
     decode(id, p);
     decode(name, p);
     decode(image_size, p);
-    decode(features, p);
+    uint64_t features;
+    decode(features, p); // unused -- preserve ABI
     if (struct_v >= 2) {
       decode(parent, p);
     }
@@ -119,7 +120,6 @@ struct cls_rbd_snap {
     f->dump_unsigned("id", id);
     f->dump_string("name", name);
     f->dump_unsigned("image_size", image_size);
-    f->dump_unsigned("features", features);
     if (has_parent()) {
       f->open_object_section("parent");
       parent.dump(f);
@@ -145,14 +145,12 @@ struct cls_rbd_snap {
     t->id = 1;
     t->name = "snap";
     t->image_size = 123456;
-    t->features = 123;
     t->flags = 31;
     o.push_back(t);
     t = new cls_rbd_snap;
     t->id = 2;
     t->name = "snap2";
     t->image_size = 12345678;
-    t->features = 1234;
     t->parent.pool = 1;
     t->parent.id = "parent";
     t->parent.snapid = 456;