[Concept,03/26] fs: ext4l: Add CONFIG_EXT4_JOURNAL option

Message ID 20251222115639.700578-4-sjg@u-boot.org
State New
Headers
Series fs: ext4l: Add support for mounting ext4 filesystems (part G) |

Commit Message

Simon Glass Dec. 22, 2025, 11:56 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add a config option to control whether journal (jbd2) support is
included for ext4 filesystems. This defaults to y

Update fs/Makefile to conditionally include jbd2/ based on this
config instead of FS_EXT4L.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/Makefile      |  2 +-
 fs/ext4l/Kconfig | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
  

Patch

diff --git a/fs/Makefile b/fs/Makefile
index b6d4f7a9cf7..969888a81da 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -22,7 +22,7 @@  obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXFAT) += exfat/
 obj-$(CONFIG_FS_EXT4) += ext4/
 obj-$(CONFIG_FS_EXT4L) += ext4l/
-obj-$(CONFIG_FS_EXT4L) += jbd2/
+obj-$(CONFIG_EXT4_JOURNAL) += jbd2/
 obj-$(CONFIG_FS_FAT) += fat/
 obj-$(CONFIG_FS_JFFS2) += jffs2/
 obj-$(CONFIG_SANDBOX) += sandbox/
diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig
index b6c2329db4a..f1fbe3b1000 100644
--- a/fs/ext4l/Kconfig
+++ b/fs/ext4l/Kconfig
@@ -1,4 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright 2025 Canonical Ltd
+# Written by Simon Glass <simon.glass@canonical.com>
 
 config FS_EXT4L
 	bool "Enable ext4 filesystem support (Linux port)"
@@ -8,3 +11,14 @@  config FS_EXT4L
 	  FS_EXT4 (the existing U-Boot ext4 implementation).
 
 	  This requires 64-bit LBA support for proper block counting.
+
+config EXT4_JOURNAL
+	bool "Enable ext4 journal support"
+	depends on FS_EXT4L
+	default y
+	help
+	  This enables journal (jbd2) support for ext4 filesystems. The
+	  journal provides crash-consistency by logging metadata changes
+	  before committing them to the filesystem.
+
+	  If unsure, say Y.