fs: ext4l: Add statfs support
Implement ext4l_statfs() to return filesystem statistics using the ext4 superblock. The function returns block size, total block count, and free block count. Add unit test to verify the statfs implementation returns valid data. Cover-letter: fs: ext4l: Complete read-only filesystem support (Part I) This series completes read-only support for the ext4l filesystem driver, which is a port of the Linux ext4 driver to U-Boot. The ext4l driver provides more complete ext4 support than the existing ext4 driver, including proper handling of extents, directory hashing, and other ext4 features. Changes include: Sandbox infrastructure: - Fix IRQ macros and buffer_head includes for sandbox builds Core fixes: - Fix path lookup by implementing proper dentry operations - Fix fscrypt_match_name to do actual name comparison Filesystem operations: - Add directory listing (opendir/readdir/closedir) - Add file existence check (exists) - Add file size query (size) - Add file read support (read) - Add UUID query (uuid) - Add filesystem statistics (statfs) New command: - Add fsinfo command to display filesystem statistics Testing: - Add comprehensive unit tests for all operations - Enable fsuuid command for sandbox testing END Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
@@ -125,6 +125,13 @@ class TestExt4l:
|
||||
f'ut -f fs fs_test_ext4l_uuid_norun fs_image={ext4_image}')
|
||||
assert 'failures: 0' in output
|
||||
|
||||
def test_statfs(self, ubman, ext4_image):
|
||||
"""Test that ext4l can return filesystem statistics."""
|
||||
with ubman.log.section('Test ext4l statfs'):
|
||||
output = ubman.run_command(
|
||||
f'ut -f fs fs_test_ext4l_statfs_norun fs_image={ext4_image}')
|
||||
assert 'failures: 0' in output
|
||||
|
||||
def test_fsinfo(self, ubman, ext4_image):
|
||||
"""Test that fsinfo command displays filesystem statistics."""
|
||||
with ubman.log.section('Test ext4l fsinfo'):
|
||||
|
||||
Reference in New Issue
Block a user