[Concept,00/21] ext4l: Add Kconfig options to reduce binary size (part P)

Message ID 20260108185149.1995917-1-sjg@u-boot.org
Headers
Series ext4l: Add Kconfig options to reduce binary size (part P) |

Message

Simon Glass Jan. 8, 2026, 6:51 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

This series adds various Kconfig options to the ext4l filesystem driver
to allow disabling optional features and reduce binary size.

New configuration options include:
- CONFIG_EXT4L_DEBUG: Control verbose error messages
- CONFIG_EXT4_FS_POSIX_ACL: POSIX access control lists
- CONFIG_EXT4_FS_SECURITY: Security labels (SELinux, etc.)
- CONFIG_EXT4_MBALLOC: Multiblock allocator
- CONFIG_EXT4_MBALLOC_PREFETCH: Block prefetching
- CONFIG_EXT4_FAST_COMMIT_REPLAY: Fast commit journal replay
- CONFIG_EXT4_MOUNT_OPTS: Mount option parsing

The series also excludes write-related functions from read-only builds
and makes extended attributes and inline-data support optional.

Some tweaks are included to enable ext4l to build on ARM.

Finally, ext4l is enabled on firefly-rk3288 as an example configuration.

Some initial results on code size:

- ext4l is currently 170K larger than ext4 with write-support
- this series reduces the read-only penalty to 91K and with
  write-support to 116K

This is still a substantial code-size increase, despite the efforts of
this series. There is definitely more that could be done, but I haven't
seen any more large opportunties yet.

There is still a fair bit of cleanup needed in the stubs, in particular
with the ext4_uboot.h file. I expect there will be at least a few more
series after this one.


Simon Glass (21):
  ext4l: Use div64.h instead of defining locally
  ext4l: Make use of log.2 instead of defining locally
  ext4l: Move __kernel_fsid_t to posix_types.h
  ext4l: Use math64.h instead of defining locally
  ext4l: Use 64-bit operations for block calculations
  ext4l: sandbox: Use volatile in set_bit() etc.
  ext4l: Correct type of invalidate_folio()
  ext4l: Tie verbose messages to CONFIG_EXT4L_DEBUG
  ext4l: Add Kconfig options for optional features
  ext4l: Make extended attributes (xattr) optional
  ext4l: Add optional inline data and indirect-block support
  ext4l: Add a CONFIG_EXT4_MBALLOC_PREFETCH option
  ext4l: Add a CONFIG_EXT4_FAST_COMMIT_REPLAY option
  ext4l: Add a CONFIG_EXT4_FS_POSIX_ACL option
  ext4l: Add a CONFIG_EXT4_FS_SECURITY option
  ext4l: Add a CONFIG_EXT4_MBALLOC option
  ext4l: Exclude write functions from read-only builds
  ext4l: Exclude transaction commits from read-only builds
  ext4l: Skip the journal flush in read-only builds
  ext4l: Add a CONFIG_EXT4_MOUNT_OPTS option
  configs: firefly-rk3288: Enable ext4l filesystem

 arch/sandbox/include/asm/bitops.h      |   6 +-
 arch/sandbox/include/asm/posix_types.h |   4 +
 configs/firefly-rk3288_defconfig       |   2 +
 fs/ext4/Kconfig                        |   1 +
 fs/ext4l/Kconfig                       | 157 ++++++++++++++++-
 fs/ext4l/Makefile                      |  20 ++-
 fs/ext4l/ext4.h                        | 224 +++++++++++++++++++++++--
 fs/ext4l/ext4_uboot.h                  |  48 +-----
 fs/ext4l/fast_commit.c                 |   4 +
 fs/ext4l/file.c                        |   2 +-
 fs/ext4l/interface.c                   |  11 +-
 fs/ext4l/mballoc.c                     |   5 +-
 fs/ext4l/namei.c                       |  28 ++--
 fs/ext4l/stub.c                        |  21 +--
 fs/ext4l/super.c                       |  94 ++++++++---
 fs/ext4l/symlink.c                     |   6 +-
 fs/ext4l/xattr.h                       |  83 +++++++++
 fs/jbd2/checkpoint.c                   |   4 +
 fs/jbd2/journal.c                      |  17 +-
 19 files changed, 605 insertions(+), 132 deletions(-)