From: Ilya Dryomov Date: Thu, 23 Jul 2015 12:49:31 +0000 (+0300) Subject: rbd: rename --object-extents option to --whole-object X-Git-Tag: v9.0.3~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5352%2Fhead;p=ceph.git rbd: rename --object-extents option to --whole-object --object-extents is a bit confusing - extent is generally something of a varying length and here the meaning is "diff whole objects". Rename it to --whole-object (the name of diff_iterate() parameter). Signed-off-by: Ilya Dryomov --- diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index b894d577ecaf..9ad0fb8f06c2 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -144,7 +144,7 @@ Parameters This will disable features that are dependent upon exclusive ownership of the image. -.. option:: --object-extents +.. option:: --whole-object Specifies that the diff should be limited to the extents of a full object instead of showing intra-object deltas. When the object map feature is @@ -223,7 +223,7 @@ Commands The --stripe-unit and --stripe-count arguments are optional, but must be used together. -:command:`export-diff` [--from-snap *snap-name*] [--object-extents] (*image-spec* | *snap-spec*) *dest-path* +:command:`export-diff` [--from-snap *snap-name*] [--whole-object] (*image-spec* | *snap-spec*) *dest-path* Exports an incremental diff for an image to dest path (use - for stdout). If an initial snapshot is specified, only changes since that snapshot are included; otherwise, any regions of the image that contain data are included. The end snapshot is specified @@ -245,7 +245,7 @@ Commands continuing. If there was an end snapshot we verify it does not already exist before applying the changes, and create the snapshot when we are done. -:command:`diff` [--from-snap *snap-name*] [--object-extents] *image-spec* | *snap-spec* +:command:`diff` [--from-snap *snap-name*] [--whole-object] *image-spec* | *snap-spec* Dump a list of byte extents in the image that have changed since the specified start snapshot, or since the image was created. Each output line includes the starting offset (in bytes), the length of the region (in bytes), and either 'zero' or 'data' to indicate diff --git a/src/rbd.cc b/src/rbd.cc index e0cf488b87ef..ee30e03ea14e 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -118,10 +118,10 @@ void usage() " \"rbd/$(basename )\" is\n" " assumed for if\n" " omitted\n" -" diff [--from-snap ] [--object-extents]\n" +" diff [--from-snap ] [--whole-object]\n" " | print extents that differ since\n" " a previous snap, or image creation\n" -" export-diff [--from-snap ] [--object-extents]\n" +" export-diff [--from-snap ] [--whole-object]\n" " ( | ) export an incremental diff to\n" " path, or \"-\" for stdout\n" " merge-diff merge and into\n" @@ -1261,7 +1261,7 @@ static int export_diff_cb(uint64_t ofs, size_t _len, int exists, void *arg) } static int do_export_diff(librbd::Image& image, const char *fromsnapname, - const char *endsnapname, bool object_extents, + const char *endsnapname, bool whole_object, const char *path) { int r; @@ -1312,7 +1312,7 @@ static int do_export_diff(librbd::Image& image, const char *fromsnapname, } ExportContext ec(&image, fd, info.size); - r = image.diff_iterate2(fromsnapname, 0, info.size, true, object_extents, + r = image.diff_iterate2(fromsnapname, 0, info.size, true, whole_object, export_diff_cb, (void *)&ec); if (r < 0) goto out; @@ -1358,7 +1358,7 @@ static int diff_cb(uint64_t ofs, size_t len, int exists, void *arg) } static int do_diff(librbd::Image& image, const char *fromsnapname, - bool object_extents, Formatter *f) + bool whole_object, Formatter *f) { int r; librbd::image_info_t info; @@ -1378,7 +1378,7 @@ static int do_diff(librbd::Image& image, const char *fromsnapname, om.t->define_column("Type", TextTable::LEFT, TextTable::LEFT); } - r = image.diff_iterate2(fromsnapname, 0, info.size, true, object_extents, + r = image.diff_iterate2(fromsnapname, 0, info.size, true, whole_object, diff_cb, &om); if (f) { f->close_section(); @@ -2984,7 +2984,7 @@ int main(int argc, const char **argv) long long stripe_unit = 0, stripe_count = 0; long long bench_io_size = 4096, bench_io_threads = 16, bench_bytes = 1 << 30; string bench_pattern = "seq"; - bool diff_object_extents = false; + bool diff_whole_object = false; std::string val, parse_err; std::ostringstream err; @@ -3114,8 +3114,8 @@ int main(int argc, const char **argv) output_format = strdup(val.c_str()); output_format_specified = true; } - } else if (ceph_argparse_flag(args, i, "--object-extents", (char *)NULL)) { - diff_object_extents = true; + } else if (ceph_argparse_flag(args, i, "--whole-object", (char *)NULL)) { + diff_whole_object = true; } else if (ceph_argparse_binary_flag(args, i, &pretty_format, NULL, "--pretty-format", (char*)NULL)) { } else { ++i; @@ -3768,7 +3768,7 @@ if (!set_conf_param(v, p1, p2, p3)) { \ break; case OPT_DIFF: - r = do_diff(image, fromsnapname, diff_object_extents, formatter.get()); + r = do_diff(image, fromsnapname, diff_whole_object, formatter.get()); if (r < 0) { cerr << "rbd: diff error: " << cpp_strerror(-r) << std::endl; return -r; @@ -3776,7 +3776,7 @@ if (!set_conf_param(v, p1, p2, p3)) { \ break; case OPT_EXPORT_DIFF: - r = do_export_diff(image, fromsnapname, snapname, diff_object_extents, path); + r = do_export_diff(image, fromsnapname, snapname, diff_whole_object, path); if (r < 0) { cerr << "rbd: export-diff error: " << cpp_strerror(-r) << std::endl; return -r; diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index e025f204d3ac..182237507de9 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -28,10 +28,10 @@ "rbd/$(basename )" is assumed for if omitted - diff [--from-snap ] [--object-extents] + diff [--from-snap ] [--whole-object] | print extents that differ since a previous snap, or image creation - export-diff [--from-snap ] [--object-extents] + export-diff [--from-snap ] [--whole-object] ( | ) export an incremental diff to path, or "-" for stdout merge-diff merge and into