Commit Graph

5 Commits

Author SHA1 Message Date
Simon Glass
3235605698 linux: ext4l: Fix REQ_OP and BH_OwnsData bit positions
The REQ_OP flags (REQ_SYNC, REQ_FUA) use bits 0-1, which collide
with REQ_OP_WRITE (value 1). Move the flags to bits 8+ and add
REQ_OP_MASK to properly separate operation from flags.

Move BH_OwnsData from buffer_head.h to ext4_uboot.h to keep
Linux headers unmodified. Define it as BH_JBDPrivateStart to
avoid conflicts with JBD2 state bits (17-25).

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-30 13:15:37 -07:00
Simon Glass
1b4240fda6 linux: buffer_head: Include atomic.h directly
The comment about atomic_t being expected from the including file is
outdated. Include asm-generic/atomic.h directly to provide the atomic_t
type definition.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-27 13:24:26 -07:00
Simon Glass
6131797256 fs: ext4l: Add buffer_head I/O infrastructure
Add support.c with buffer_head I/O infrastructure for ext4l:
- Buffer cache for caching buffer_heads across lookups
- Buffer allocation/free functions
- Block I/O functions (sb_getblk, sb_bread, brelse, submit_bh, bh_read)

This keeps interface.c focused on the U-Boot filesystem layer interface.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-22 05:07:02 -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
6f87163eda linux: Add buffer_head.h and journal-head.h stubs
Add stub headers for buffer head management:

- buffer_head.h: buffer head structure and state management
  functions (bh_*_bit helpers, BUFFER_FNS/TAS_BUFFER_FNS macros)
- journal-head.h: journal buffer head structure for jbd2

These provide minimal interfaces needed for ext4l filesystem
compilation in U-Boot.

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