]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fs: exfat: Implement trivial 'rename' support
authorMarek Vasut <marex@denx.de>
Sun, 13 Apr 2025 08:55:04 +0000 (10:55 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 21 Apr 2025 17:07:04 +0000 (11:07 -0600)
Implement exfat_fs_rename() to rename or move files. This is used
by the 'mv' generic FS interface command. The rename implementation
for other filesystems was added recently and was not part of exfat
porting layer due to merge issue, which made 'mv' command crash,
fix this by adding the missing implementation.

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
fs/exfat/io.c
fs/fs.c
include/exfat.h

index 43c05713ed014070bc20ad4741bda687b807115b..c56f56759875ec426a5abdf8c5d4d3d1b2805ece 100644 (file)
@@ -1013,6 +1013,11 @@ exit:
        return err;
 }
 
+int exfat_fs_rename(const char *old_path, const char *new_path)
+{
+       return exfat_rename(&ctxt.ef, old_path, new_path);
+}
+
 void exfat_fs_close(void)
 {
        exfat_unmount(&ctxt.ef);
diff --git a/fs/fs.c b/fs/fs.c
index 0b62217fd594ffad30957e3af44ebbe51ba16398..1f36872fb9a23f78f7048917eac4db065c7be783 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -401,6 +401,7 @@ static struct fstype_info fstypes[] = {
                .ln = fs_ln_unsupported,
                .unlink = exfat_fs_unlink,
                .mkdir = exfat_fs_mkdir,
+               .rename = exfat_fs_rename,
        },
 #endif
        {
index 7e43beeb3484303988618e5bc883500b9ea144f8..75fce5b6566d9c7685833db70212504d73f1d7f9 100644 (file)
@@ -20,5 +20,6 @@ int exfat_fs_unlink(const char *filename);
 int exfat_fs_mkdir(const char *dirname);
 int exfat_fs_write(const char *filename, void *buf, loff_t offset,
                   loff_t len, loff_t *actwrite);
+int exfat_fs_rename(const char *old_path, const char *new_path);
 
 #endif /* _EXFAT_H */