summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorGoffredo Baroncelli <kreijack@gmail.com>2012-10-29 18:53:17 +0100
committerDavid Sterba <dsterba@suse.cz>2013-01-17 18:27:54 +0100
commit8f76aee6bc7cd0155ca6a251f6656a5560298f54 (patch)
treed2b429ed9ad343a9fabad55dc06dd18f2e2ced47 /cmds-filesystem.c
parent043437d8e1609874018a28996d1878847e57bd55 (diff)
Move parse_size() to utils.[hc]
Move the function from cmds-filesystem.c and mkfs.c to utils.c Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 9c43d351..507239ad 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -311,32 +311,6 @@ static int cmd_sync(int argc, char **argv)
return 0;
}
-static u64 parse_size(char *s)
-{
- int len = strlen(s);
- char c;
- u64 mult = 1;
-
- if (!isdigit(s[len - 1])) {
- c = tolower(s[len - 1]);
- switch (c) {
- case 'g':
- mult *= 1024;
- case 'm':
- mult *= 1024;
- case 'k':
- mult *= 1024;
- case 'b':
- break;
- default:
- fprintf(stderr, "Unknown size descriptor %c\n", c);
- exit(1);
- }
- s[len - 1] = '\0';
- }
- return atoll(s) * mult;
-}
-
static int parse_compress_type(char *s)
{
if (strcmp(optarg, "zlib") == 0)