]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rbd: use rbd.create4() for all formats
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Thu, 2 Jun 2016 07:47:57 +0000 (03:47 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Tue, 21 Jun 2016 01:36:17 +0000 (21:36 -0400)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
src/tools/rbd/action/Create.cc

index dc3bb834d3363f574b63f6ae8c1a08f16b4bd096..0f25c0f5cbab4a284ce61f03b0e6e00c79237414 100644 (file)
@@ -18,23 +18,7 @@ namespace po = boost::program_options;
 static int do_create(librbd::RBD &rbd, librados::IoCtx& io_ctx,
                      const char *imgname, uint64_t size,
                     librbd::ImageOptions& opts) {
-  int r;
-  uint64_t format;
-  r = opts.get(RBD_IMAGE_OPTION_FORMAT, &format);
-  assert(r == 0);
-  if (format == 1) {
-    uint64_t order;
-    r = opts.get(RBD_IMAGE_OPTION_ORDER, &order);
-    assert(r == 0);
-    int order_ = order;
-    r = rbd.create(io_ctx, imgname, size, &order_);
-  } else {
-    r = rbd.create4(io_ctx, imgname, size, opts);
-  }
-  if (r < 0) {
-    return r;
-  }
-  return 0;
+  return rbd.create4(io_ctx, imgname, size, opts);
 }
 
 void get_arguments(po::options_description *positional,