common: support f2fs for _scratch_mkfs_sized
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)
The mkfs.f2fs has an option to build a certain sized filesystem by giving
the number of sectors.

So, this patch adds to use that.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index 4164d9e13275df429e1fbd131d2273904de5fe31..b75afc5aab50f94c161301c9120cb10a878eed95 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -741,6 +741,11 @@ _scratch_mkfs_sized()
        $MKFS_REISER4_PROG $MKFS_OPTIONS -y -b $blocksize $SCRATCH_DEV \
                           `expr $fssize / 1024`
        ;;
+    f2fs)
+       # mkfs.f2fs requires # of sectors as an input for the size
+       sector_size=`blockdev --getss $SCRATCH_DEV`
+       $MKFS_F2FS_PROG $MKFS_OPTIONS $SCRATCH_DEV `expr $fssize / $sector_size`
+       ;;
     *)
        _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
        ;;