fs: exfat: Implement trivial 'rename' support

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: b86a651b64 ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Marek Vasut
2025-04-13 10:55:04 +02:00
committed by Tom Rini
parent 1761c298af
commit e5cbc3d287
3 changed files with 7 additions and 0 deletions

View 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);

View File

@@ -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
{

View 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 */