1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

dmstats: allow --bounds with 'create --filemap'

This commit is contained in:
Bryn M. Reeves 2016-07-07 09:48:09 +01:00
parent 4bb57341bd
commit bce1bc4ca3

View 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);