mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
fs/mount: add ftl proxy to mount block filesystem on mtd device
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
+21
-7
@@ -140,9 +140,6 @@ extern const struct mountpt_operations g_mnemofs_operations;
|
|||||||
|
|
||||||
static const struct fsmap_t g_mdfsmap[] =
|
static const struct fsmap_t g_mdfsmap[] =
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_FS_ROMFS
|
|
||||||
{ "romfs", &g_romfs_operations },
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_FS_SPIFFS
|
#ifdef CONFIG_FS_SPIFFS
|
||||||
{ "spiffs", &g_spiffs_operations },
|
{ "spiffs", &g_spiffs_operations },
|
||||||
#endif
|
#endif
|
||||||
@@ -334,11 +331,28 @@ int nx_mount(FAR const char *source, FAR const char *target,
|
|||||||
#endif /* MDFS_SUPPORT */
|
#endif /* MDFS_SUPPORT */
|
||||||
if (mops == NULL)
|
if (mops == NULL)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Failed to find MTD based file system %s\n",
|
#ifdef BDFS_SUPPORT
|
||||||
filesystemtype);
|
mops = mount_findfs(g_bdfsmap, filesystemtype);
|
||||||
|
#endif /* BDFS_SUPPORT */
|
||||||
|
if (mops == NULL)
|
||||||
|
{
|
||||||
|
ferr("ERROR: Failed to find MTD based file system %s\n",
|
||||||
|
filesystemtype);
|
||||||
|
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout_with_inode;
|
goto errout_with_inode;
|
||||||
|
}
|
||||||
|
#ifdef CONFIG_MTD
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inode_release(drvr_inode);
|
||||||
|
ret = mtd_proxy(source, mountflags, &drvr_inode);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
goto errout_with_inode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user