From 19cf368342249b8579345241709e3772540ca220 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Mon, 26 Mar 2012 16:17:08 -0400 Subject: 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 --- mkfs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mkfs.c') diff --git a/mkfs.c b/mkfs.c index d3f45bdf..c531ef25 100644 --- a/mkfs.c +++ b/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; -- cgit v1.2.3