[Concept,00/19] ext4l: Reduce ext4_uboot.h size by moving code to include/linux

Message ID 20260117011448.3007171-1-sjg@u-boot.org
Headers
Series ext4l: Reduce ext4_uboot.h size by moving code to include/linux |

Message

Simon Glass Jan. 17, 2026, 1:14 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

This series reduces fs/ext4l/ext4_uboot.h from 2584 to 1980 lines (a 23%
reduction) by moving definitions to appropriate include/linux/ header
files.

The ext4l subsystem requires many Linux kernel types and functions.
Rather than keeping everything in one large file, this series creates
proper stub headers in include/linux/ matching Linux kernel
organisation:

- ktime.h: Time functions and ktime_t type
- rcupdate.h: RCU stubs (single-threaded no-ops)
- shrinker.h: Memory-reclaim stubs
- mm_types.h: VM stubs (address_space, vm_area_struct)
- pagemap.h: Page cache and folio stubs
- bio.h: Block I/O stubs
- fs_context.h/fs_parser.h: Filesystem context types
- dcache.h: Dentry and qstr types
- uuid.h: UUID/GUID types
- smp.h: SMP memory barriers
- refcount.h: Reference counting type
- kobject.h: Kobject stubs
- xarray.h: XArray stubs
- mempool.h: Memory pool stubs
- kdev_t.h: Device number macros
- fsmap.h: Filesystem map definitions

Additionally, cmpxchg(), try_cmpxchg(), and xchg() are moved to
asm-generic/atomic.h, and blk_plug is added to linux/blkdev.h.

All implementations are appropriate stubs for U-Boot's single-threaded,
no-VM, no-page-cache environment.


Simon Glass (19):
  linux: Add ktime.h header with time functions
  linux: Add rcupdate.h header with RCU stubs
  linux: Add shrinker.h header with memory-reclaim stubs
  linux: Add mm_types.h header with VM stubs
  linux: Add pagemap.h header with folio and page cache stubs
  linux: Add bio.h header with block I/O stubs
  linux: Add fs_context.h and fs_parser.h headers
  linux: Add dcache.h header with dentry stubs
  linux: Add uuid.h header with UUID/GUID types
  asm-generic: atomic: Add cmpxchg() macro
  linux: Add smp.h header with SMP stubs
  linux: Add refcount.h header with refcount_t type
  linux: Add kobject.h header with kobject stubs
  linux: Add xarray.h header with XArray stubs
  linux: Add mempool.h header with memory pool stubs
  linux: Add kdev_t.h header with device number macros
  linux: blkdev: Add blk_plug structure and operations
  linux: Add fsmap.h header with filesystem map definitions
  asm-generic: atomic: Add xchg() and try_cmpxchg() macros

 fs/ext4l/ext4_fscrypt.h      |   9 +-
 fs/ext4l/ext4_uboot.h        | 738 ++++-------------------------------
 include/asm-generic/atomic.h |  55 +++
 include/linux/bio.h          | 117 ++++++
 include/linux/blkdev.h       |  25 ++
 include/linux/dcache.h       |  94 +++++
 include/linux/fs_context.h   | 154 ++++++++
 include/linux/fs_parser.h    | 110 ++++++
 include/linux/fsmap.h        |  46 +++
 include/linux/kdev_t.h       |  56 +++
 include/linux/kobject.h      |  34 ++
 include/linux/ktime.h        |  70 ++++
 include/linux/mempool.h      |  57 +++
 include/linux/mm_types.h     | 116 ++++++
 include/linux/pagemap.h      | 201 ++++++++++
 include/linux/rcupdate.h     |  54 +++
 include/linux/refcount.h     |  70 ++++
 include/linux/shrinker.h     |  83 ++++
 include/linux/smp.h          |  60 +++
 include/linux/uuid.h         | 120 ++++++
 include/linux/xarray.h       |  50 +++
 21 files changed, 1640 insertions(+), 679 deletions(-)
 create mode 100644 include/linux/bio.h
 create mode 100644 include/linux/dcache.h
 create mode 100644 include/linux/fs_context.h
 create mode 100644 include/linux/fs_parser.h
 create mode 100644 include/linux/fsmap.h
 create mode 100644 include/linux/kdev_t.h
 create mode 100644 include/linux/kobject.h
 create mode 100644 include/linux/ktime.h
 create mode 100644 include/linux/mempool.h
 create mode 100644 include/linux/mm_types.h
 create mode 100644 include/linux/pagemap.h
 create mode 100644 include/linux/rcupdate.h
 create mode 100644 include/linux/refcount.h
 create mode 100644 include/linux/shrinker.h
 create mode 100644 include/linux/smp.h
 create mode 100644 include/linux/uuid.h
 create mode 100644 include/linux/xarray.h