fs/f2fs: add option to define discard policy
authorGrzegorz Blach <grzegorz@blach.pl>
Sat, 3 Nov 2018 14:29:32 +0000 (15:29 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 3 Nov 2018 14:29:32 +0000 (15:29 +0100)
Signed-off-by: Grzegorz Blach <grzegorz@blach.pl>
[Thomas: split from the initial patch from Grzegorz]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
fs/f2fs/Config.in
fs/f2fs/f2fs.mk

index 71101d2b574912555bb88bc25dbdc9970ead70df..585b32e6a280862c82c1c05fc4ca803de1a59f41 100644 (file)
@@ -36,4 +36,10 @@ config BR2_TARGET_ROOTFS_F2FS_OVERPROVISION
          Leave at 0 to use the default overprovision ratio of
          mkfs.f2fs.
 
+config BR2_TARGET_ROOTFS_F2FS_DISCARD
+       bool "discard policy"
+       default y
+       help
+         Enable or disable discard policy.
+
 endif # BR2_TARGET_ROOTFS_F2FS
index cf79779d2e876d244b4adbeed4139def0f7cfe4f..558cddf233259bb2a30beae18ab7ba0139ef8f6b 100644 (file)
@@ -19,9 +19,16 @@ ifneq ($(BR2_TARGET_ROOTFS_F2FS_OVERPROVISION),0)
 F2FS_OVERPROVISION = $(BR2_TARGET_ROOTFS_F2FS_OVERPROVISION)
 endif
 
+ifeq ($(BR2_TARGET_ROOTFS_F2FS_DISCARD),y)
+F2FS_DISCARD = 1
+else
+F2FS_DISCARD = 0
+endif
+
 F2FS_OPTS = \
        -f \
        -l "$(F2FS_LABEL)" \
+       -t $(F2FS_DISCARD) \
        $(if $(F2FS_COLD_FILES),-e "$(F2FS_COLD_FILES)") \
        $(if $(F2FS_OVERPROVISION),-o $(F2FS_OVERPROVISION))