/****** NEWFS ******/
static char help_newfs[] = "Create a new LaFS filesystem, which can then be stored on one or more devices.";
static char *block_sizes[] = { "512", "1024", "2048", "4096", NULL };
+static char *state_sizes[] = { "512", "1024", "2048", "4096", "8192",
+ "16384", "32768", NULL };
static struct args args_newfs[] = {
{ "BLOCK-SIZE", choice, -1, {.options=block_sizes},
"Block size, 512..4096, defaults to 1024"},
{ "-block-size", choice, 0, {.options=block_sizes},
"Block size, 512..4096, defaults to 1024"},
- { "-state-size", opaque, -1, {NULL}, "Size of state block, defaults to 1024"},
+ { "-state-size", choice, -1, {.options=state_sizes},
+ "Size of state block, 512..32768, defaults to 1024"},
{ "-uuid", opaque, -1, {NULL}, "UUID - normally randomly generated"},
{ "-black", opaque, -1, {NULL}, "nothing (just testing)"},
TERMINAL_ARG
{
int blockbytes = 1024;
int state_size = 0;
- char *err = NULL;
char uuidstr[37];
uuid_t uu;
struct lafs_ino *ifile, *imfile, *rootdir;
if (args[3]) {
/* state-size was given */
- if (get_int(args[3], &state_size) < 0)
- err = "state-size must be a number";
- else if (state_size <= 0 || state_size % 1024)
- err = "state-size must be a positive multiple of 1024";
- if (err) {
- printf("newfs: %s: %s\n", err, (char*)args[3]);
- return;
- }
+ get_int(args[3], &state_size);
}
if (args[4]) {
/* uuid was given */