diff options
Diffstat (limited to 'daemon/mkfs.c')
-rw-r--r-- | daemon/mkfs.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/daemon/mkfs.c b/daemon/mkfs.c index 85442e01..c7ae50d9 100644 --- a/daemon/mkfs.c +++ b/daemon/mkfs.c @@ -33,8 +33,8 @@ /* Takes optional arguments, consult optargs_bitmask. */ int -do_mkfs_opts (const char *fstype, const char *device, int blocksize, - const char *features, int inode, int sectorsize) +do_mkfs (const char *fstype, const char *device, int blocksize, + const char *features, int inode, int sectorsize) { const char *argv[MAX_ARGS]; size_t i = 0; @@ -100,7 +100,7 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize, } /* Process blocksize parameter if set. */ - if (optargs_bitmask & GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK) { + if (optargs_bitmask & GUESTFS_MKFS_BLOCKSIZE_BITMASK) { if (blocksize <= 0 || !is_power_of_2 (blocksize)) { reply_with_error ("block size must be > 0 and a power of 2"); return -1; @@ -146,12 +146,12 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize, } } - if (optargs_bitmask & GUESTFS_MKFS_OPTS_FEATURES_BITMASK) { + if (optargs_bitmask & GUESTFS_MKFS_FEATURES_BITMASK) { ADD_ARG (argv, i, "-O"); ADD_ARG (argv, i, features); } - if (optargs_bitmask & GUESTFS_MKFS_OPTS_INODE_BITMASK) { + if (optargs_bitmask & GUESTFS_MKFS_INODE_BITMASK) { if (!extfs) { reply_with_error ("inode size (-I) can only be set on ext2/3/4 filesystems"); return -1; @@ -167,7 +167,7 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize, ADD_ARG (argv, i, inode_str); } - if (optargs_bitmask & GUESTFS_MKFS_OPTS_SECTORSIZE_BITMASK) { + if (optargs_bitmask & GUESTFS_MKFS_SECTORSIZE_BITMASK) { if (!STREQ (fstype, "ufs")) { reply_with_error ("sector size (-S) can only be set on ufs filesystems"); return -1; @@ -198,15 +198,8 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize, } int -do_mkfs (const char *fstype, const char *device) -{ - optargs_bitmask = 0; - return do_mkfs_opts (fstype, device, 0, 0, 0, 0); -} - -int do_mkfs_b (const char *fstype, int blocksize, const char *device) { - optargs_bitmask = GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK; - return do_mkfs_opts (fstype, device, blocksize, 0, 0, 0); + optargs_bitmask = GUESTFS_MKFS_BLOCKSIZE_BITMASK; + return do_mkfs (fstype, device, blocksize, 0, 0, 0); } |