]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cls/rbd: alow to call set_features asynchronously
authorMykola Golub <mgolub@mirantis.com>
Wed, 31 Aug 2016 19:30:24 +0000 (22:30 +0300)
committerMykola Golub <mgolub@mirantis.com>
Wed, 28 Sep 2016 12:17:18 +0000 (15:17 +0300)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_client.h

index 3b499c9103d00f532d6a171b35ea51c465305ed5..4a53acce9b17a0cf1cf7a31c4215a1b58498c532 100644 (file)
@@ -198,15 +198,22 @@ namespace librbd {
       return 0;
     }
 
+    void set_features(librados::ObjectWriteOperation *op, uint64_t features,
+                      uint64_t mask)
+    {
+      bufferlist bl;
+      ::encode(features, bl);
+      ::encode(mask, bl);
+
+      op->exec("rbd", "set_features", bl);
+    }
+
     int set_features(librados::IoCtx *ioctx, const std::string &oid,
                       uint64_t features, uint64_t mask)
     {
-      bufferlist inbl;
-      ::encode(features, inbl);
-      ::encode(mask, inbl);
-
       librados::ObjectWriteOperation op;
-      op.exec("rbd", "set_features", inbl);
+      set_features(&op, features, mask);
+
       return ioctx->operate(oid, &op);
     }
 
index 6969aba2a4f690f91ef4ca23e47265d454233db1..75634ce6013b738bc0c0cddd57873deec0e1a26f 100644 (file)
@@ -56,6 +56,8 @@ namespace librbd {
                     const std::string &object_prefix);
     int get_features(librados::IoCtx *ioctx, const std::string &oid,
                     snapid_t snap_id, uint64_t *features);
+    void set_features(librados::ObjectWriteOperation *op, uint64_t features,
+                     uint64_t mask);
     int set_features(librados::IoCtx *ioctx, const std::string &oid,
                      uint64_t features, uint64_t mask);
     int get_object_prefix(librados::IoCtx *ioctx, const std::string &oid,