fs/mount: add ftl proxy to mount block filesystem on mtd device

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-01-11 15:34:05 +08:00 committed by Xiang Xiao
parent 9d1e7a0510
commit ace2683492

View File

@ -140,9 +140,6 @@ extern const struct mountpt_operations g_mnemofs_operations;
static const struct fsmap_t g_mdfsmap[] =
{
#ifdef CONFIG_FS_ROMFS
{ "romfs", &g_romfs_operations },
#endif
#ifdef CONFIG_FS_SPIFFS
{ "spiffs", &g_spiffs_operations },
#endif
@ -334,11 +331,28 @@ int nx_mount(FAR const char *source, FAR const char *target,
#endif /* MDFS_SUPPORT */
if (mops == NULL)
{
ferr("ERROR: Failed to find MTD based file system %s\n",
filesystemtype);
#ifdef BDFS_SUPPORT
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;
goto errout_with_inode;
ret = -ENODEV;
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