|
29 | 29 | #include "src/common/libfilemap/filemap.h" |
30 | 30 | #include "src/common/libutil/fileref.h" |
31 | 31 |
|
32 | | -static const int default_chunksize = 1048576; |
33 | | -static const int default_small_file_threshold = 4096; |
| 32 | +static const char *default_chunksize = "1M"; |
| 33 | +static const char *default_small_file_threshold = "4K"; |
34 | 34 |
|
35 | 35 | static json_t *get_list_option (optparse_t *p, |
36 | 36 | const char *name, |
@@ -175,10 +175,12 @@ static int subcmd_map (optparse_t *p, int ac, char *av[]) |
175 | 175 | } |
176 | 176 | ctx.p = p; |
177 | 177 | ctx.verbose = optparse_get_int (p, "verbose", 0); |
178 | | - ctx.chunksize = optparse_get_int (p, "chunksize", default_chunksize); |
179 | | - ctx.threshold = optparse_get_int (p, |
180 | | - "small-file-threshold", |
181 | | - default_small_file_threshold); |
| 178 | + ctx.chunksize = optparse_get_size_int (p, |
| 179 | + "chunksize", |
| 180 | + default_chunksize); |
| 181 | + ctx.threshold = optparse_get_size_int (p, |
| 182 | + "small-file-threshold", |
| 183 | + default_small_file_threshold); |
182 | 184 | ctx.disable_mmap = optparse_hasopt (p, "disable-mmap"); |
183 | 185 | ctx.tags = get_list_option (p, "tags", "main"); |
184 | 186 | ctx.h = builtin_get_flux_handle (p); |
@@ -375,12 +377,12 @@ static struct optparse_option map_opts[] = { |
375 | 377 | .usage = "Change to DIR before mapping", }, |
376 | 378 | { .name = "verbose", .key = 'v', .has_arg = 2, .arginfo = "[LEVEL]", |
377 | 379 | .usage = "Increase output detail.", }, |
378 | | - { .name = "chunksize", .has_arg = 1, .arginfo = "N", |
| 380 | + { .name = "chunksize", .has_arg = 1, .arginfo = "N[KMG]", |
379 | 381 | .usage = "Limit blob size to N bytes with 0=unlimited" |
380 | | - " (default 1048576)", }, |
381 | | - { .name = "small-file-threshold", .has_arg = 1, .arginfo = "N", |
| 382 | + " (default 1M)", }, |
| 383 | + { .name = "small-file-threshold", .has_arg = 1, .arginfo = "N[KMG]", |
382 | 384 | .usage = "Adjust the maximum size of a \"small file\" in bytes" |
383 | | - " (default 4096)", }, |
| 385 | + " (default 4K)", }, |
384 | 386 | { .name = "disable-mmap", .has_arg = 0, |
385 | 387 | .usage = "Never mmap(2) files into the content cache", }, |
386 | 388 | { .name = "tags", .key = 'T', .has_arg = 1, .arginfo = "NAME,...", |
|
0 commit comments