summaryrefslogtreecommitdiffstats
path: root/src/tools/rbd
diff options
context:
space:
mode:
authorDongsheng Yang <dongsheng.yang@easystack.cn>2016-07-11 13:44:24 +0200
committerDongsheng Yang <dongsheng.yang@easystack.cn>2016-07-22 13:04:10 +0200
commit6264acb4694d8fd1c02be9c38d16a159bb93e7ac (patch)
treee8d1744df8e718882bcc699d7beb6cd556dcac94 /src/tools/rbd
parenttools/rbd: set order to default value if it is not specified in options. (diff)
downloadceph-6264acb4694d8fd1c02be9c38d16a159bb93e7ac.tar.xz
ceph-6264acb4694d8fd1c02be9c38d16a159bb93e7ac.zip
tools/rbd: use create4() for both of format 1 and format 2.
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Diffstat (limited to 'src/tools/rbd')
-rw-r--r--src/tools/rbd/action/Import.cc23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/tools/rbd/action/Import.cc b/src/tools/rbd/action/Import.cc
index b69bd48e776..a935c38b79f 100644
--- a/src/tools/rbd/action/Import.cc
+++ b/src/tools/rbd/action/Import.cc
@@ -131,28 +131,7 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
}
- uint64_t format;
- r = opts.get(RBD_IMAGE_OPTION_FORMAT, &format);
- assert(r == 0);
- if (format == 1) {
- uint64_t stripe_unit, stripe_count;
- r = opts.get(RBD_IMAGE_OPTION_STRIPE_UNIT, &stripe_unit);
- assert(r == 0);
- r = opts.get(RBD_IMAGE_OPTION_STRIPE_COUNT, &stripe_count);
- assert(r == 0);
-
- // weird striping not allowed with format 1!
- if ((stripe_unit || stripe_count) &&
- (stripe_unit != (1ull << order) && stripe_count != 1)) {
- std::cerr << "non-default striping not allowed with format 1; "
- << "use --image-format 2" << std::endl;
- return -EINVAL;
- }
- int order_ = order;
- r = rbd.create(io_ctx, imgname, size, &order_);
- } else {
- r = rbd.create4(io_ctx, imgname, size, opts);
- }
+ r = rbd.create4(io_ctx, imgname, size, opts);
if (r < 0) {
std::cerr << "rbd: image creation failed" << std::endl;
goto done;