[PATCH v2 6/6] efi_loader: support file rename in SetInfo()

2025-02-17 Thread Gabriel Dalimonte
Following the UEFI specification. The specification did not seem to delineate if file_name was explicitly a file name only, or could include paths to move the file to a different directory. The more generous interpretation of supporting paths was selected. Signed-off-by: Gabriel Dalimonte

[PATCH v2 4/6] fs: fat: update parent dirs metadata on dentry create/delete

2025-02-17 Thread Gabriel Dalimonte
s/unlink.html [3] https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html [4] https://elixir.bootlin.com/linux/v6.12.6/source/fs/fat/namei_vfat.c#L682 Signed-off-by: Gabriel Dalimonte --- Changes in v2: - remove setting ATTR_ARCH on parent dirs during renames - skip updating timestamps if

[PATCH v2 5/6] efi_loader: move path out of file_handle

2025-02-17 Thread Gabriel Dalimonte
In order to support renaming via SetInfo(), path must allow for longer values than what was originally present when file_handle was allocated. Signed-off-by: Gabriel Dalimonte --- (no changes since v1) lib/efi_loader/efi_file.c | 13 + 1 file changed, 9 insertions(+), 4 deletions

[PATCH v2 3/6] fs: fat: add rename

2025-02-17 Thread Gabriel Dalimonte
are likely familiar with in terms of behavior. The 'FAT_RENAME' Kconfig option was added to prevent code size increase on size-oriented builds like SPL. [1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html Signed-off-by: Gabriel Dalimonte --- Changes in v2: - ch

[PATCH v2 2/6] fs: add rename infrastructure

2025-02-17 Thread Gabriel Dalimonte
/9799919799/functions/rename.html Signed-off-by: Gabriel Dalimonte --- Changes in v2: - cleanup log message and verbosity in fs_rename() - update fs_close() docstring with reference to fs_rename() - clarify fs_rename() behaviour in docstring --- fs/fs.c | 32

[PATCH v2 1/6] fs: fat: factor out dentry link create/delete

2025-02-17 Thread Gabriel Dalimonte
The create_link() code was previously duplicated in two existing functions. The two functions will be used in a future commit to achieve renaming. Signed-off-by: Gabriel Dalimonte --- Changes in v2: - update create_link() docstring - remove ATTR_ARCH being implicitly set in create_link

[PATCH v2 0/6] This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo().

2025-02-17 Thread Gabriel Dalimonte
le_name and new_path Gabriel Dalimonte (6): fs: fat: factor out dentry link create/delete fs: add rename infrastructure fs: fat: add rename fs: fat: update parent dirs metadata on dentry create/delete efi_loader: move path out of file_handle efi_loader: support file rename in

[PATCH 6/6] efi_loader: support file rename in SetInfo()

2025-01-22 Thread Gabriel Dalimonte
Following the UEFI specification. The specification did not seem to delineate if file_name was explicitly a file name only, or could include paths to move the file to a different directory. The more generous interpretation of supporting paths was selected. Signed-off-by: Gabriel Dalimonte

[PATCH 5/6] efi_loader: move path out of file_handle

2025-01-22 Thread Gabriel Dalimonte
In order to support renaming via SetInfo(), path must allow for longer values than what was originally present when file_handle was allocated. Signed-off-by: Gabriel Dalimonte --- lib/efi_loader/efi_file.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib

[PATCH 4/6] fs: fat: update parent dirs metadata on rename

2025-01-22 Thread Gabriel Dalimonte
directories has changed. Signed-off-by: Gabriel Dalimonte --- fs/fat/fat_write.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index f9f7051e30..2559e38d5b 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat

[PATCH 1/6] fs: fat: factor out dentry link create/delete

2025-01-22 Thread Gabriel Dalimonte
Signed-off-by: Gabriel Dalimonte --- fs/fat/fat_write.c | 122 - 1 file changed, 66 insertions(+), 56 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index ea877ee917..b86e78abc0 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat

[PATCH 3/6] fs: fat: add rename

2025-01-22 Thread Gabriel Dalimonte
+ +try: +# 128MiB volume +fs_img = fs_helper.mk_fs(u_boot_config, fs_type, 0x800, '128MB', mount_dir) +except CalledProcessError as err: +pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.forma

[PATCH 2/6] fs: add rename infrastructure

2025-01-22 Thread Gabriel Dalimonte
Signed-off-by: Gabriel Dalimonte --- fs/fs.c | 47 +++ include/fs.h | 13 + 2 files changed, 60 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 99ddcc5e37..160a43c957 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -143,6 +143,12 @@ static

[PATCH 0/6] add support for renaming to EFI_FILE_PROTOCOL.SetInfo()

2025-01-22 Thread Gabriel Dalimonte
concrete implementation for the FAT filesystem. Gabriel Dalimonte (6): fs: fat: factor out dentry link create/delete fs: add rename infrastructure fs: fat: add rename fs: fat: update parent dirs metadata on rename efi_loader: move path out of file_handle efi_loader: support file rename in