fs: smartfs: Add necessary aligned access in smartfs_rename()

smartfs_rename() was stuck on the boards they need
CONFIG_SMARTFS_ALIGNED_ACCESS.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
This commit is contained in:
Takumi Ando 2023-12-26 13:55:09 +09:00 committed by Xiang Xiao
parent 992719730f
commit dde0872b63

View File

@ -1983,10 +1983,22 @@ int smartfs_rename(FAR struct inode *mountpt, FAR const char *oldrelpath,
direntry = (FAR struct smartfs_entry_header_s *)
&fs->fs_rwbuffer[oldentry.doffset];
#if CONFIG_SMARTFS_ERASEDSTATE == 0xff
#ifdef CONFIG_SMARTFS_ALIGNED_ACCESS
smartfs_wrle16(&direntry->flags,
smartfs_rdle16(&direntry->flags)
& ~SMARTFS_DIRENT_ACTIVE);
#else
direntry->flags &= ~SMARTFS_DIRENT_ACTIVE;
#endif
#else /* CONFIG_SMARTFS_ERASEDSTATE == 0xff */
#ifdef CONFIG_SMARTFS_ALIGNED_ACCESS
smartfs_wrle16(&direntry->flags,
smartfs_rdle16(&direntry->flags)
| SMARTFS_DIRENT_ACTIVE);
#else
direntry->flags |= SMARTFS_DIRENT_ACTIVE;
#endif
#endif /* CONFIG_SMARTFS_ERASEDSTATE == 0xff */
/* Now write the updated flags back to the device */