mkfs: make -l and -n an alias for each other
We don't allow different leaf and node blocksizes, so this just makes the two options mean the same thing Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
e22827e9bb
commit
19cf368342
12
mkfs.c
12
mkfs.c
|
@ -59,6 +59,9 @@ static u64 parse_size(char *s)
|
|||
int len = strlen(s);
|
||||
char c;
|
||||
u64 mult = 1;
|
||||
u64 ret;
|
||||
|
||||
s = strdup(s);
|
||||
|
||||
if (!isdigit(s[len - 1])) {
|
||||
c = tolower(s[len - 1]);
|
||||
|
@ -77,7 +80,9 @@ static u64 parse_size(char *s)
|
|||
}
|
||||
s[len - 1] = '\0';
|
||||
}
|
||||
return atol(s) * mult;
|
||||
ret = atol(s) * mult;
|
||||
free(s);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int make_root_dir(struct btrfs_root *root, int mixed)
|
||||
|
@ -1235,6 +1240,8 @@ int main(int ac, char **av)
|
|||
data_profile_opt = 1;
|
||||
break;
|
||||
case 'l':
|
||||
case 'n':
|
||||
nodesize = parse_size(optarg);
|
||||
leafsize = parse_size(optarg);
|
||||
break;
|
||||
case 'L':
|
||||
|
@ -1247,9 +1254,6 @@ int main(int ac, char **av)
|
|||
case 'M':
|
||||
mixed = 1;
|
||||
break;
|
||||
case 'n':
|
||||
nodesize = parse_size(optarg);
|
||||
break;
|
||||
case 's':
|
||||
sectorsize = parse_size(optarg);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue