Skip to content

FAT file renaming

Daniel Venzin u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 7 repliesIn review
  2. v24 patches 1 replySuperseded

Changes in v3 from the cover letter

- Abort the rename if the destination is a path instead of a file
- Add fatrnfile command for renaming files in a FAT file system
- Verify FAT file rename functionality with unit tests

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fs: Add unimplemented rename hook to FS layerfs/fs.c include/fs.h+39 -02 replies
2/6efi_loader: Support for file renaminglib/efi_loader/efi_file.c+8 -31 reply
3/6fs: fat: Refactor delete_dentry_long interfacefs/fat/fat_write.c+16 -81 reply
4/6fs: fat: Support basic file renamefs/fat/fat_write.c fs/fs.c include/fat.h+127 -12 replies
5/6cmd: fat: Add fatrnfile commandcmd/fat.c fs/fs.c include/fs.h+35 -01 reply
6/6test/py: fs: Add fstest/rnfile testtest/py/tests/test_fs/conftest.py test/py/tests/test_fs/test_rnfile.py+168 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/6] FAT file renaming

This patch series represents a continuation of version 2 [1], incorporating tests and improvements.

[1] https://lore.kernel.org/u-boot/20250203211719.GX1233568@bill-the-cat/

Changes in v3:
- Abort the rename if the destination is a path instead of a file
- Add fatrnfile command for renaming files in a FAT file system
- Verify FAT file rename functionality with unit tests

Changes in v2:
- Adapt variable names for better consistency
- Add missing rename hooks
- Use EFI_ACCESS_DENIED for unsuccessful renames
- Avoid using of "== 0"
- Move the call to set_blk_dev earlier in the sequence
- Refactor delete_dentry_long for improved reusability
- Separate the rename implementation from changes in the filesystem layer
- Eliminate code duplication with delete_dentry_long(..)
- Ensure that the source file exists, but not the destination file
- Free the fatbuf if it has been reinitialized with fat_itr_root
- Delete orphaned FAT entry after copying file metadata

Daniel Venzin (6):
fs: Add unimplemented rename hook to FS layer
efi_loader: Support for file renaming
fs: fat: Refactor delete_dentry_long interface
fs: fat: Support basic file rename
cmd: fat: Add fatrnfile command
test/py: fs: Add fstest/rnfile test

 cmd/fat.c                            |  13 +++
 fs/fat/fat_write.c                   | 149 +++++++++++++++++++++++++--
 fs/fs.c                              |  50 +++++++++
 include/fat.h                        |   1 +
 include/fs.h                         |  11 ++
 lib/efi_loader/efi_file.c            |  11 +-
 test/py/tests/test_fs/conftest.py    |  75 ++++++++++++++
 test/py/tests/test_fs/test_rnfile.py |  93 +++++++++++++++++
 8 files changed, 392 insertions(+), 11 deletions(-)
 create mode 100644 test/py/tests/test_fs/test_rnfile.py
Signature · 1 line
2.39.5