]> sourceware.org Git - lvm2.git/commitdiff
dmstats: allow --bounds with 'create --filemap'
authorBryn M. Reeves <bmr@redhat.com>
Thu, 7 Jul 2016 08:48:09 +0000 (09:48 +0100)
committerBryn M. Reeves <bmr@redhat.com>
Fri, 8 Jul 2016 16:27:52 +0000 (17:27 +0100)
tools/dmsetup.c

index 637a82ab8b35597186b205dbcc2163c28dc4026b..b31788c64f42bc1815413ce26225a62ca6b247cf 100644 (file)
@@ -4882,7 +4882,9 @@ static char *_get_abspath(const char *path)
 static int _stats_create_file(CMD_ARGS)
 {
        const char *alias, *program_id = DM_STATS_PROGRAM_ID;
+       const char *histogram = _string_args[BOUNDS_ARG];
        uint64_t *regions, *region, count = 0;
+       struct dm_histogram *bounds = NULL;
        char *path, *abspath = NULL;
        int group, fd, precise;
        struct dm_stats *dms;
@@ -4907,11 +4909,6 @@ static int _stats_create_file(CMD_ARGS)
                return 0;
        }
 
-       if (_switches[BOUNDS_ARG]) {
-               log_error("--bounds is not yet supported with --filemap.");
-               return 0;
-       }
-
        /* _stats_create_file does not use _process_all() */
        if (names) {
                log_error("Device argument not compatible with --filemap.");
@@ -4945,6 +4942,9 @@ static int _stats_create_file(CMD_ARGS)
                }
        }
 
+       if (histogram && !(bounds = dm_histogram_bounds_from_string(histogram)))
+               return_0;
+
        if (_switches[PROGRAM_ID_ARG])
                program_id = _string_args[PROGRAM_ID_ARG];
        if (!strlen(program_id) && !_switches[FORCE_ARG])
@@ -4988,7 +4988,7 @@ static int _stats_create_file(CMD_ARGS)
        }
 
        regions = dm_stats_create_regions_from_fd(dms, fd, group, precise,
-                                                 NULL, alias);
+                                                 bounds, alias);
 
        if (close(fd))
                log_error("Error closing %s", path);
This page took 0.052158 seconds and 5 git commands to generate.