crosshatch: switch userdata filesystem from EXT4 to F2FS
This patch switches the filesystem for userdata partition from EXT4 to F2FS.
It activates ICE for FBE and quota supports by default.
The benefits on F2FS over EXT4 come from:
- sequential write nature based on log-structured filesystem,
- asynchronous trim management,
- background filesystem defragmentation,
- ease of UFS vertical optimization.
You can find more information from:
- https://f2fs.wiki.kernel.org/
Bug: 68995224
Bug: 68721442
Bug: 63260873
Bug: 63264176
Bug: 68721511
Change-Id: I0f98e61140eb56263dea4fa90e3b343df24c6ea5
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index 5c5aa95..f9fc3b3 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -75,6 +75,7 @@
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096
TARGET_USERIMAGES_USE_EXT4 := true
BOARD_USERDATAIMAGE_PARTITION_SIZE := 10737418240
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
BOARD_PERSISTIMAGE_PARTITION_SIZE := 41943040
BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_FLASH_BLOCK_SIZE := 131072
diff --git a/device-common.mk b/device-common.mk
index 015216d..cb19cd8 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -14,6 +14,8 @@
# limitations under the License.
#
+TARGET_USERIMAGES_USE_F2FS := true
+
LOCAL_PATH := device/google/crosshatch
# define hardware platform
diff --git a/fstab.hardware b/fstab.hardware
index 994c4fa..90d9d97 100644
--- a/fstab.hardware
+++ b/fstab.hardware
@@ -2,7 +2,7 @@
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system / ext4 ro,barrier=1 wait,slotselect
-/dev/block/bootdevice/by-name/userdata /data ext4 errors=panic,noatime,nosuid,nodev,barrier=1,noauto_da_alloc latemount,wait,check,formattable
+/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard latemount,wait,check,fileencryption=ice,quota,formattable
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect
/devices/soc/a600000.ssusb/a600000.dwc3* auto vfat defaults voldmanaged=usb:auto