From: Jason Dillaman Date: Tue, 16 Jan 2018 19:57:34 +0000 (-0500) Subject: cls/rbd: removed unused snapshot feature bitmask X-Git-Tag: v13.0.2~426^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=41c5f323fdc2429abb063823da08b76a42fa5a65;p=ceph.git cls/rbd: removed unused snapshot feature bitmask Signed-off-by: Jason Dillaman --- diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index f5b7050b25c6..a595a773b142 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -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()); diff --git a/src/cls/rbd/cls_rbd.h b/src/cls/rbd/cls_rbd.h index c340d3ce9ecf..690641f05654 100644 --- a/src/cls/rbd/cls_rbd.h +++ b/src/cls/rbd/cls_rbd.h @@ -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;