1112 Commits

Author SHA1 Message Date
Simon Glass
00009659d9 ext4l: Add inline.c to build
Add the ext4 inline data implementation file to the build.

Add stubs to ext4_uboot.h:
- FGP_WRITEBEGIN flag (combined from FGP_LOCK | FGP_WRITE | FGP_CREAT |
  FGP_STABLE)
- kmap_local_folio, kunmap_local for memory mapping
- folio_zero_tail, folio_zero_segment for folio zeroing
- mapping_gfp_mask for address space GFP mask

Remove obsolete inline data stubs from stub.c that are now provided
by inline.c.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
c9c040e276 ext4l: Add xattr.c to build
Add the ext4 extended attributes core implementation file to the build.

Add stubs and definitions to ext4_uboot.h:
- inode_get_ctime_sec, inode_get_mtime_sec, inode_set_ctime,
  inode_set_atime, inode_set_mtime functions
- WARN_ONCE, pr_warn_once macros
- lockdep_assert_held_read stub
- struct mb_cache, struct mb_cache_entry and mb_cache_* function stubs
- xattr_handler_can_list, xattr_prefix stubs
- I_MUTEX_* constants and inode_lock_nested stub
- PF_MEMALLOC_NOFS constant
- struct mnt_idmap definition and nop_mnt_idmap declaration
- kvmalloc macro
- dquot_alloc_space_nodirty, dquot_free_space_nodirty,
  dquot_alloc_block, dquot_free_block declarations

Add stub implementations:
- nop_mnt_idmap global
- dquot_* functions for quota operations

Remove obsolete xattr stubs from stub.c that are now provided by xattr.c.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
841d3a5b40 ext4l: Add namei.c to build
Add directory name operations (lookup, create, link, unlink, symlink,
mkdir, rmdir, mknod, rename, tmpfile) to the ext4l filesystem.

Add stubs for:
- fscrypt name operations (match, prepare symlink/link/rename)
- Dentry operations (d_splice_alias, d_obtain_alias, d_instantiate, etc)
- Fast commit tracking functions
- Inline directory functions
- Fileattr get/set

Extend inode_operations struct with directory operation members.
Add permission mode constants (S_IRWXUGO) and rename flags.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
1345cf686d ext4l: Add symlink.c to build
Add symlink.c which provides symlink inode operations.

Changes needed:
- Add ext4_uboot.h include to symlink.c
- Add delayed_call struct and set_delayed_call macro
- Add kfree_link definition
- Add nd_terminate_link helper function
- Add get_link member to inode_operations struct
- Add simple_get_link function for fast symlinks
- Add i_link field to struct inode
- Add fscrypt_get_symlink and fscrypt_symlink_getattr stubs
- Add ext4_read_inline_link stub
- Remove ext4_symlink_inode_operations and
  ext4_fast_symlink_inode_operations stubs from stub.c

Drop some duplicate declarations in ext4_uboot.h

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
0519a66f3d ext4l: Add fsync.c to build
Add fsync.c which provides filesystem sync operations.

Changes needed:
- Add ext4_uboot.h include to fsync.c
- Remove redundant Linux header includes
- Add trace_ext4_sync_file_enter/exit stubs
- Add dentry operation stubs (d_find_any_alias, dget_parent)
- Add sync operation stubs (sync_mapping_buffers, sync_inode_metadata,
  generic_buffers_fsync_noflush, file_write_and_wait_range,
  file_check_and_advance_wb_err)
- Add jbd2_trans_will_send_data_barrier stub
- Remove ext4_sync_file stub from stub.c (now in fsync.c)

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
b45cae614c ext4l: Add file.c to build
Add file.c which provides file operations for ext4l filesystem.

Changes needed for file.c support:
- Add i_writecount and i_rwsem fields to struct inode
- Add IOMAP_DIO_* flags to linux/iomap.h
- Add vm_operations_struct definition
- Add VM flags (VM_SHARED, VM_HUGEPAGE, etc.)
- Add vm_area_desc and pipe_inode_info structures
- Add FMODE_* flags and SEEK_HOLE/SEEK_DATA to linux/fs.h
- Add vfsmount, path structs and f_path to struct file
- Add inode_trylock*, lockdep_assert_held_write macros
- Add filemap_fault, filemap_map_pages stubs
- Add inode_operations struct definition
- Add various stubs: d_path, fscrypt_file_open, fsverity_file_open,
  dquot_file_open, sb_start_intwrite_trylock, ext4_listxattr

Simplify ext4_file_operations and ext4_file_inode_operations
initializers to use only the members defined in U-Boot's structs.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-21 11:36:34 +00:00
Simon Glass
3b4667ed88 ext4l: Add super.c to build
Add super.c to the ext4l Makefile and provide the infrastructure
needed to compile it:

- Add stubs for block device operations (bdev_file_open_by_dev,
  bdev_fput, bdev_getblk, submit_bh, trylock_buffer)
- Add stubs for NFS export helpers (generic_fh_to_dentry/parent)
- Add stubs for filesystem operations (sync_filesystem, dquot_suspend)
- Add stubs for string operations (strreplace, strtomem_pad)
- Add stubs for memory allocation (alloc_inode_sb, kvzalloc)
- Add stubs for ratelimit, workqueue, and trace functions
- Add fs_context and fs_parameter structures for mount options
- Add blk_holder_ops structure for block device holder operations
- Add pragma to suppress unused function/variable warnings
- Add __maybe_unused to __init/__exit macros in init.h

The only change to super.c itself is replacing the Linux kernel
includes with the U-Boot compatibility header ext4_uboot.h.

Series-to: concept
Cover-letter:
ext4l: Add more ext4 files to the build (part D)
This series continues the ext4l port by adding super.c to the build. The
super.c file contains the superblock operations and filesystem
registration code from the kernel's ext4 driver.

To support this effort compilation, this series adds numerous stubs and
compatibility shims for Linux kernel interfaces not available in
U-Boot, including block device operations, filesystem context
handling, NFS export helpers, and various utility functions.

In particular, fs/ext4l/ext4_uboot.h contains a lot of U-Boot specific
declarations and stubs, with fs/ext4l/stub.c containing various others.

The goal is to eventually have a fully functional ext4 implementation
ported from Linux that can be used for both reading and writing ext4
filesystems in U-Boot.
END

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
5f4cc9eb3c ext4l: Add dir.c to build
Add dir.c to the Makefile and provide necessary stubs:
- Replace Linux includes with ext4_uboot.h
- Add fscrypt directory operation stubs
- Add readahead, inode version, and dir_emit stubs
- Add struct file_operations with needed members
- Add generic_read_dir, ext4_llseek, ext4_htree_fill_tree stubs
- Add ext4_ioctl, ext4_sync_file, ext4_dirblock_csum_verify stubs

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
e3f8042575 ext4l: Add inode.c to build
Add inode.c to the Makefile with minimal changes:
- Replace Linux kernel includes with ext4_uboot.h
- Add cast in ext4_inode_peek_iversion() to fix const qualifier warning
- Add __maybe_unused to variables in ext4_print_free_blocks()

Update ext4_uboot.h with additional stubs needed by inode.c:
- address_space_operations: add migrate_folio, swap_activate members,
  fix write_begin/write_end/writepages signatures
- Add buffer_migrate_folio, buffer_migrate_folio_norefs, noop_dirty_folio

Add stub functions in stub.c for inode.c dependencies:
- Inline data: ext4_try_to_write_inline_data, ext4_generic_write_inline_data,
  ext4_write_inline_data_end
- xattr: ext4_xattr_delete_inode, ext4_xattr_inode_array_free
- JBD2: jbd2_inode_cache, jbd2_journal_try_to_free_buffers,
  jbd2_journal_init_jbd_inode

Also add required stub headers:
- linux/mpage.h - multi-page I/O stub
- linux/rmap.h - reverse mapping stub
- linux/atomic.h - atomic operations stub

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
14253d1733 ext4l: Add kiocb, iov_iter structures and IOCB_* constants
Add infrastructure needed for file.c and other VFS-integrated files:

- Add struct kiocb (kernel I/O control block)
- Add struct iov_iter forward declaration
- Add IOCB_DIRECT, IOCB_NOWAIT, IOCB_ATOMIC constants
- Add iov_iter_truncate, iov_iter_count, iov_iter_alignment stubs
- Remove ext4_init_acl macro (provided by acl.h)

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
8558bdc0e2 ext4l: Add xattr_user.c and xattr_hurd.c
Add xattr_user.c and xattr_hurd.c to the ext4l build:

- Update includes to use ext4_uboot.h
- Add d_sb member to struct dentry
- Add XATTR_HURD_PREFIX to linux/xattr.h

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
5e40f1668d ext4l: Add xattr_trusted.c
Add xattr_trusted.c to the ext4l build with necessary changes:

- Update xattr_trusted.c includes to use ext4_uboot.h
- Add xattr.h include to ialloc.c for ext4_init_security
- Remove duplicate ext4_init_security declaration from ext4_uboot.h
  (now provided by xattr.h inline stub)
- Add ext4_xattr_get and ext4_xattr_set stubs

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
42df586aeb ext4l: Add orphan.c and required support
Add orphan.c to the ext4l build and fix various build issues:

- Add atomic_inc/atomic_dec macros to ext4_uboot.h
- Add s_flags member to struct super_block and SB_RDONLY constant
- Add bdev_read_only() stub function
- Add kvfree() and kvmalloc_array() to linux/slab.h
- Add stub functions for orphan.c: ext4_reserve_inode_write,
  ext4_superblock_csum_set, ext4_mark_iloc_dirty, ext4_truncate,
  ext4_feature_set_ok, ext4_bread
- Fix orphan.c to use U-Boot include pattern
- Remove linux/atomic.h include from buffer_head.h (types provided
  by ext4_uboot.h)
- Add kunit/static_stub.h and linux/nospec.h stub headers
- Simplify seq_file.h macros

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00
Simon Glass
c29defa81d ext4l: Add stubs for xattr functions used by ialloc.c
Add stub declarations and implementations for xattr functions that
ialloc.c calls but which are defined in xattr.c (not yet compiled):
- __ext4_xattr_set_credits
- ext4_init_security

Add declarations to ext4_uboot.h and implementations to stub.c.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:13 -07:00
Simon Glass
390a94ee47 ext4l: Fix unused variable warnings in extents_status.c
Mark variables as __maybe_unused where they are only used in macro
calls that expand to no-ops in U-Boot's single-threaded environment:
- tree in ext4_es_try_to_merge_left/right
- es_stats in ext4_seq_es_shrinker_info_show
- ei in ext4_clear_inode_es, ext4_remove_pending, ext4_is_pending

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:13 -07:00
Simon Glass
60a16564a1 ext4l: Add extents_status.c compilation support
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>
2025-12-18 12:34:17 -07:00
Simon Glass
f04cd9dbc2 ext4l: Add extents.c compilation support
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>
2025-12-18 12:34:17 -07:00
Simon Glass
334ad928b4 ext4l: Add balloc.c compilation support
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>
2025-12-18 12:34:17 -07:00
Simon Glass
ff44e2dbb4 ext4l: Add ext4_jbd2.c compilation support
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>
2025-12-18 12:34:17 -07:00
Simon Glass
5ed072d603 linux: Move mutex definitions to linux/mutex.h
Move mutex definitions from compat.h to a dedicated mutex.h header,
matching the Linux structure.

U-Boot is single-threaded so mutexes are no-ops. The new header provides
struct mutex and mutex_init/lock/unlock stubs.

Update compat.h to include linux/mutex.h.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-18 12:34:17 -07:00
Simon Glass
4c245023bb ext4l: Add hash.c compilation support
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>
2025-12-18 12:34:17 -07:00
Simon Glass
778701861a ext4l: Plumb in the Kconfig
Update Kconfig options so that CONFIG_EXT4L can be enabled.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-18 12:34:16 -07:00
Simon Glass
7c5788a85d ext4l: Add CONFIG_FS_EXT4L build infrastructure
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>
2025-12-18 12:34:16 -07:00
Simon Glass
f90fcc5d04 ext4l: Extract module declarations into their own file
Create include/linux/module.h with stub definitions for kernel module
support. U-Boot doesn't use loadable modules, so these are no-ops.

Includes:
- THIS_MODULE, try_module_get(), module_put()
- module_init(), module_exit()
- module_param() and variants
- MODULE_* macros (LICENSE, AUTHOR, DESCRIPTION, etc.)

Update compat.h to include module.h and remove duplicate definitions.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-17 14:01:22 +00:00
Simon Glass
5ce331eb7e ext4l: bring in Kconfig and Makefile
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>
2025-12-16 13:19:59 +00:00
Simon Glass
00e5dc76b5 ext4l: bring in xattr files
Copy xattr.c, xattr.h, xattr_hurd.c, xattr_security.c, xattr_trusted.c,
and xattr_user.c from Linux v6.18 fs/ext4 directory.

These files implement extended attribute support for ext4:
- xattr.c/h: core xattr implementation
- xattr_hurd: Hurd translator xattr handler
- xattr_security: security label xattr handler
- xattr_trusted: trusted xattr handler
- xattr_user: user xattr handler

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
98ddbdae46 ext4l: bring in resize, symlink, sysfs, truncate, verity, and readpage
Copy resize.c, symlink.c, sysfs.c, truncate.h, verity.c, and readpage.c
from Linux v6.18 fs/ext4 directory.

- resize: online filesystem resize support
- symlink: symbolic link operations
- sysfs: sysfs attribute interface
- truncate.h: truncate-related declarations
- verity: fs-verity support
- readpage: page reading operations

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
1d6c60270f ext4l: bring in migrate, mmp, move_extent, orphan, and page-io
Copy migrate.c, mmp.c, move_extent.c, orphan.c, and page-io.c from
Linux v6.18 fs/ext4 directory.

- migrate: migration between indirect and extent mapping
- mmp: multi-mount protection
- move_extent: extent moving ioctl support
- orphan: orphan inode handling
- page-io: page I/O operations

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
096fea33ba ext4l: bring in inode-test, ioctl, and mballoc headers
Copy inode-test.c, ioctl.c, mballoc.h, and mballoc-test.c from Linux
v6.18 fs/ext4 directory.

- inode-test: KUnit tests for inode timestamp handling
- ioctl: filesystem ioctl handlers
- mballoc.h: multiblock allocator header
- mballoc-test: KUnit tests for multiblock allocator

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
4b9dfbed5f ext4l: bring in indirect and inline
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>
2025-12-16 13:19:59 +00:00
Simon Glass
1e271714d9 ext4l: bring in file, fsmap, and ialloc
Copy file.c, fsmap.c, fsmap.h, and ialloc.c from Linux v6.18 fs/ext4
directory.

- file: file operations (open, read, write, mmap, etc.)
- fsmap: filesystem block mapping for GETFSMAP ioctl
- ialloc: inode allocation

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
9295071662 ext4l: bring in ext4_jbd2 and fast_commit
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>
2025-12-16 13:19:59 +00:00
Simon Glass
2e527f71fe ext4l: bring in extents_status, fsync, and hash
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>
2025-12-16 13:19:59 +00:00
Simon Glass
8af80aa97e ext4l: bring in files a-d
Copy acl.c, acl.h, balloc.c, bitmap.c, block_validity.c, crypto.c, and
dir.c from Linux v6.18 fs/ext4 directory.

- acl: POSIX ACL support
- balloc: block allocation helpers
- bitmap: bitmap manipulation utilities
- block_validity: block validity checking
- crypto: filesystem encryption support
- dir: directory entry handling

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:59 +00:00
Simon Glass
a3faa9e2d4 ext4l: bring in ext4.h
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>
2025-12-16 13:19:59 +00:00
Simon Glass
cab2feaa92 ext4l: bring in super.c
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>
2025-12-16 13:19:59 +00:00
Simon Glass
4153a0b94d ext4l: bring in namei.c
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>
2025-12-16 13:19:59 +00:00
Simon Glass
d32c25d292 ext4l: bring in mballoc.c
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>
2025-12-16 13:19:59 +00:00
Simon Glass
08a334993a ext4l: bring in inode.c
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>
2025-12-16 13:19:59 +00:00
Simon Glass
e07c4209c1 ext4l: bring in extents.c
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>
2025-12-16 13:19:59 +00:00
Simon Glass
20652517c8 fat: Use standard types for fixed-size values
Convert all __u8, __u16, and __u32 types to their u8, u16, u32
equivalents throughout the FAT filesystem code.

Series-to: u-boot
Series-cc: heinrich
Cover-letter:
fat: Some code improvements
This is an attempt to improve the structure of the FAT code, since it
doesn't fully follow the U-Boot conventions:

- fat_write.c includes fat.c which is odd
- use of __u32 and its ilk
- use of typedef
- old-style struct comments

This series resolves these problems, making it easier to take on other
improvements in future.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-13 19:59:03 -07:00
Simon Glass
aa6f5484e6 fat: Remove typedefs in fat.h
Convert all typedefs in fat.h to normal struct declarations.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 18:39:22 -07:00
Simon Glass
ffb7d606ff fat: Update struct fat_itr to kernel-doc style
Convert the struct fat_itr documentation from the older style with
separate @field comments to the standard kernel-doc style where field
descriptions are listed in the header comment block.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 18:39:13 -07:00
Simon Glass
cb30dcb8b6 fat: Separate fat.c from fat_write.c
Currently fat_write.c includes fat.c directly, which is unusual and
makes the code harder to maintain. Use the internal header file to hold
shared functions, to avoid this.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 18:39:11 -07:00
Simon Glass
b92ee1a12f fat: Create an internal header file
As a first step towards separating fat.c from fat_write.c, create a
header file for the definitions.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 18:28:57 -07:00
Simon Glass
7bd184c0c5 lib: Plumb in argon2 library
Add a Kconfig optiion to enable this library and add it to the lib/
Makefile, being careful to avoid a conflict with the existing blake2b
implementation.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-11 04:09:41 -07:00
Simon Glass
ef2d6ec193 fs: Avoid calling efi_set_bootdev() from the app
This function is used by the EFI loader but we want to avoid it for the
app, since it records global state.

We don't intend to support running arbitrary EFI apps outside of a
bootstd context, so drop this call for the EFI app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 17:01:22 -06:00
Simon Glass
2b66e2f9d3 fs: Reuse a directory device when accessing the same dir
At present a new directory device is created for every access to a
directory. This means that a new device is always created when 'ls' is
used.

Where the directory being accessed matches an existing device, this is
not necessary.

Check that path against existing directories and reuse the device if
possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 15:14:47 +02:00
Simon Glass
878f27e552 fs: Use an empty string for the root directory
It is easier to use an empty string when the root directory is intended.
Adjust the code to drop use of "/" and NULL and just use and empty
string.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 14:29:06 +02:00
Simon Glass
cd93381ec5 emulation: x86: Rename VENDOR_EMULATION to ARCH_QEMU_X86
This name matches the ARM name and 'emulation' is not really a vendor.
Use ARCH_QEMU_X86 instead, moving that option from its existing location.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 05:21:59 +02:00