Add the extent status tree implementation to the ext4l build. This
module tracks extent status in memory to support delayed allocation
and SEEK_DATA/SEEK_HOLE operations.
Changes:
- Add extents_status.o to Makefile
- Add include guard to acl.h
- Add shrinker, ktime, and ratelimit stubs to ext4_uboot.h
- Guard iomap definitions in ext4_uboot.h when iomap.h is included
- Guard dquot macros when quotaops.h is included
- Remove stub functions now provided by extents_status.c
- Add ext4_da_release_space/update_reserve_space stubs
Series-to: u-boot
Cover-letter:
ext4l: Adjust some of the smaller files (part C)
This series makes various changes to allow some of the ext4l files to
compile successfully.
It provides a basic Kconfig to allow selecting ext4l (ext4 from Linu)
instead of the existing ext4 implementation.
To reduce the large number of include/linux files somewhat and to avoid
exceesive diffs against the Linux files, a new ext4_uboot.h header is
created. This will expand over time.
END
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add extents.c (extent handling) to the build and provide stubs.
Changes to extents.c:
- Replace Linux includes with ext4_uboot.h
Changes to ext4_uboot.h:
- Add __GFP_MOVABLE, __GFP_FS memory allocation flags
- Add FIEMAP_EXTENT_* flags for fiemap operations
- Add FALLOC_FL_* flags for fallocate operations
- Add O_SYNC flag and struct file with f_mapping
- Add struct iomap and iomap_ops for I/O mapping
- Add IOMAP_* type constants
- Add struct fiemap_extent_info and FIEMAP_FLAG_* constants
- Add i_blkbits member to inode struct
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add balloc.c (block allocation) to the build and provide stubs.
Changes to balloc.c:
- Replace Linux includes with ext4_uboot.h
Changes to mballoc.h:
- Replace Linux includes with ext4_uboot.h
Changes to ext4_uboot.h:
- Add REQ_META, REQ_PRIO, REQ_RAHEAD block I/O request flags
- Add CAP_SYS_ADMIN, CAP_SYS_RESOURCE capability stubs
- Add capable() stub that always returns true
- Add s_id member to super_block struct
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add ext4_jbd2.c to the build and provide the necessary stubs. To avoid
build warnings while we build out the required interfacing, start a new
stub.c file containing empty functions.
Changes to ext4_jbd2.c:
- Remove trace/events/ext4.h include (not needed)
- Stub out ext4_check_bdev_write_error() since U-Boot lacks async
I/O error tracking
- Add return after BUG() to silence non-void function warning
Changes to ext4_jbd2.h:
- Include ext4_uboot.h instead of linux/fs.h
Changes to ext4_uboot.h:
- Add sb_writers struct and SB_FREEZE constants
- Add _RET_IP_ macro
- Add mapping_large_folio_support() stub
- Add WARN_ON_ONCE/WARN_ON as proper stubs
- Add BUG(), might_sleep(), sb_rdonly() stubs
- Add trace function stubs
- Add buffer operation stubs (wait_on_buffer, mark_buffer_dirty, etc.)
- Add inode_needs_sync stub
- Include linux/sched.h for current task
Changes to include/linux/buffer_head.h:
- Add inline bh_*_bit functions for buffer state management
- Use bh_ prefixed functions in BUFFER_FNS/TAS_BUFFER_FNS macros
Changes to include/linux/fs.h:
- Add bd_disk to block_device struct
Changes to include/linux/workqueue.h:
- Fix flush_work macro to avoid unused value warning
Add stub functions to interface.c for jbd2 journal functions:
- jbd2__journal_start, jbd2_journal_stop
- jbd2_journal_free_reserved, jbd2_journal_start_reserved
- jbd2_journal_extend, jbd2_journal_get_write_access
- jbd2_journal_set_triggers, jbd2_journal_forget
- jbd2_journal_revoke, jbd2_journal_get_create_access
- jbd2_journal_dirty_metadata
- __ext4_error, __ext4_std_error, ext4_decode_error
Keep full Linux jbd2.h with compatibility header includes.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add hash.c to the ext4l build with required compatibility headers.
Create ext4_uboot.h with minimal definitions needed for hash.c:
- rol32() rotation function
- struct inode and super_block stubs
- struct qstr and dx_hash_info for directory hashing
- DX_HASH_* constants and EXT4_HTREE_EOF_32BIT
- fscrypt stub functions (encryption not supported)
- ext4_warning macros (stubbed out)
Modify hash.c to use ext4_uboot.h instead of Linux kernel headers.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add the basic build infrastructure for the ext4l filesystem:
- Add FS_EXT4L Kconfig option in fs/ext4l/Kconfig
- Add ext4l to fs/Kconfig and fs/Makefile
- Add fstype_info entry in fs_legacy.c with unsupported stubs
- Add minimal interface.c with stub probe/close functions
This allows sandbox to build with CONFIG_FS_EXT4L=y. The filesystem
doesn't work yet - all operations return unsupported.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Copy Kconfig and Makefile from Linux v6.18 fs/ext4 directory.
- Kconfig: configuration options for ext4
- Makefile: build rules
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy indirect.c and inline.c from Linux v6.18 fs/ext4 directory.
- indirect: indirect block mapping for ext2/ext3 compatibility
- inline: inline data support for small files stored in inode
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy ext4_jbd2.c, ext4_jbd2.h, fast_commit.c, and fast_commit.h from
Linux v6.18 fs/ext4 directory.
- ext4_jbd2: ext4-specific JBD2 journal interface wrappers
- fast_commit: fast commit journal optimization
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy extents_status.c, extents_status.h, fsync.c, and hash.c from
Linux v6.18 fs/ext4 directory.
- extents_status: extent status tree for tracking extent state
- fsync: file synchronization operations
- hash: directory entry hashing for htree directories
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy ext4.h from Linux v6.18 fs/ext4 directory. This is the main header
file defining structures, constants, and function prototypes for ext4.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy super.c from Linux v6.18 fs/ext4 directory. This file implements
superblock operations including mount, unmount, and filesystem options.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy namei.c from Linux v6.18 fs/ext4 directory. This file implements
directory operations including lookup, create, link, unlink, and rename.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy mballoc.c from Linux v6.18 fs/ext4 directory. This file implements
the multiblock allocator for efficient block allocation.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy inode.c from Linux v6.18 fs/ext4 directory. This file implements
inode operations including reading, writing, and truncating files.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy extents.c and ext4_extents.h from Linux v6.18 fs/ext4 directory.
These files implement the extent-based block mapping used by ext4.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>