common: support f2fs for _scratch_mkfs_sized

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>
This commit is contained in:
Jaegeuk Kim
2015-12-21 18:01:47 +11:00
committed by Dave Chinner
parent cd372aa094
commit a687688b7f
+5
View File
@@ -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"
;;