]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: show striping parameters with 'info' command
authorSage Weil <sage@inktank.com>
Mon, 1 Oct 2012 22:32:13 +0000 (15:32 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Oct 2012 22:34:03 +0000 (15:34 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/rbd.cc

index 640a8e33dc3b2df3e0ca0c7c3a1f14e3417a88ac..4a7f29754bfc332a3416b44d76ead7f4227f2e4c 100644 (file)
@@ -318,6 +318,7 @@ static int do_show_info(const char *imgname, librbd::Image& image,
   uint8_t old_format;
   uint64_t overlap, features;
   bool snap_protected;
+
   int r = image.stat(info, sizeof(info));
   if (r < 0)
     return r;
@@ -351,7 +352,6 @@ static int do_show_info(const char *imgname, librbd::Image& image,
        << std::endl
        << "\tformat: " << (old_format ? "1" : "2")
        << std::endl;
-
   if (!old_format) {
     cout << "\tfeatures: " << feature_str(features) << std::endl;
   }
@@ -370,6 +370,12 @@ static int do_show_info(const char *imgname, librbd::Image& image,
         << "@" << parent_snapname << std::endl;
     cout << "\toverlap: " << prettybyte_t(overlap) << std::endl;
   }
+
+  // striping info, if feature is set
+  if (features & RBD_FEATURE_STRIPINGV2) {
+    cout << "\tstripe unit: " << prettybyte_t(image.get_stripe_unit()) << std::endl
+        << "\tstripe count: " << prettybyte_t(image.get_stripe_count()) << std::endl;
+  }
   return 0;
 }