diff options
author | Chris Mason <chris.mason@oracle.com> | 2012-03-26 16:17:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-03-26 16:17:08 -0400 |
commit | 19cf368342249b8579345241709e3772540ca220 (patch) | |
tree | 4f23ed39c9d13a5477f9635ef3b667569db21f8c /mkfs.c | |
parent | e22827e9bb9634540d32bf29b23b26989e384902 (diff) |
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>
Diffstat (limited to 'mkfs.c')
-rw-r--r-- | mkfs.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; |