Merge "Reapply "dragonboards: fstab: Mount /data as F2FS partition"" into main
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 08c5c57..2683711 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -19,7 +19,10 @@
 TARGET_NO_RECOVERY := true
 
 BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := erofs
-TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_USE_F2FS := true
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
+# Currently, f2fs block size must be equal to page size
+BOARD_F2FS_BLOCKSIZE := 4096
 TARGET_COPY_OUT_VENDOR := vendor
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := erofs
 TARGET_COPY_OUT_SYSTEM_EXT := system_ext
diff --git a/fstab.common b/fstab.common
index c618b7a..6772e38 100644
--- a/fstab.common
+++ b/fstab.common
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata /data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/1d84000.ufshc/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/1d84000.ufshc/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/8804000.sdhci/mmc_host/mmc*	auto	auto	defaults	voldmanaged=sdcard1:auto
diff --git a/shared/utils/sdcard-boot/fstab.mmc b/shared/utils/sdcard-boot/fstab.mmc
index 387a0cd..1f689e8 100644
--- a/shared/utils/sdcard-boot/fstab.mmc
+++ b/shared/utils/sdcard-boot/fstab.mmc
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/8804000.mmc/by-name/userdata	/data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/8804000.mmc/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/8804000.mmc/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/8804000.mmc/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/a8f8800.usb/*/usb*		auto	auto	defaults	voldmanaged=usb1:auto
diff --git a/shared/utils/sdcard-boot/fstab.sdhci b/shared/utils/sdcard-boot/fstab.sdhci
index c385ba6..746f516 100644
--- a/shared/utils/sdcard-boot/fstab.sdhci
+++ b/shared/utils/sdcard-boot/fstab.sdhci
@@ -1,5 +1,5 @@
 system		/system		erofs	ro				wait,logical,first_stage_mount,slotselect
-/dev/block/platform/soc@0/8804000.sdhci/by-name/userdata	/data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota
+/dev/block/platform/soc@0/8804000.sdhci/by-name/userdata	/data		f2fs	nodev,noatime,nosuid,inlinecrypt,reserve_root=32768	latemount,wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,check,fscompress,checkpoint=fs
 /dev/block/platform/soc@0/8804000.sdhci/by-name/metadata	/metadata	ext4	noatime,nosuid,nodev,discard					wait,formattable,first_stage_mount,check
 /dev/block/platform/soc@0/8804000.sdhci/by-name/misc /misc emmc defaults defaults
 /devices/platform/soc@0/a8f8800.usb/*/usb*		auto	auto	defaults	voldmanaged=usb1:auto