fs: fat: add rename
authorGabriel Dalimonte <gabriel.dalimonte@gmail.com>
Mon, 17 Feb 2025 18:26:44 +0000 (13:26 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 7 Mar 2025 17:50:22 +0000 (11:50 -0600)
commit06159a1465fc97d8d7b72b9bea39a396f6e7057c
tree71a27cbcbc587d8157021fb1d8a7cca37ec9c8fc
parentd9c149664fa7a0c2eabfc046dcf89637f655364b
fs: fat: add rename

The implementation roughly follows the POSIX specification for
rename() [1]. The ordering of operations attempting to minimize the chance
for data loss in unexpected circumstances.

The 'mv' command was implemented as a front end for the rename operation
as that is what most users 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 <gabriel.dalimonte@gmail.com>
cmd/fs.c
doc/usage/cmd/mv.rst [new file with mode: 0644]
fs/fat/Kconfig
fs/fat/fat_write.c
fs/fs.c
include/fat.h
include/fs.h
lib/efi_loader/Kconfig
test/py/tests/test_fs/conftest.py
test/py/tests/test_fs/fstest_helpers.py
test/py/tests/test_fs/test_rename.py [new file with mode: 0644]