diff options
| author | Bernard Xiong <[email protected]> | 2018-07-14 12:19:30 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-07-14 12:19:30 +0800 |
| commit | bb5c3da74fcc585e9c6c7ec59c7d3533cbffa198 (patch) | |
| tree | 6e2e8fbbf2af6e357c7e144848875b1de42eedd0 | |
| parent | 1758f5773eb235d71b975990c2d89467a777ee0e (diff) | |
| parent | 6139e6a3ccab60552fb1cabb044c53a917456f10 (diff) | |
Merge pull request #1624 from armink/fix_dfs
Update DFS fd_max and errror log
| -rw-r--r-- | components/dfs/Kconfig | 3 | ||||
| -rw-r--r-- | components/dfs/src/dfs.c | 1 | ||||
| -rw-r--r-- | components/dfs/src/dfs_fs.c | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index ee40ba3f31..87b346026d 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -24,8 +24,7 @@ if RT_USING_DFS config DFS_FD_MAX int "The maximal number of opened files" - default 16 if RT_USING_DFS_NFS - default 4 + default 16 config RT_USING_DFS_ELMFAT bool "Enable elm-chan fatfs" diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 459ab52793..e7fd7394cf 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -197,6 +197,7 @@ int fd_new(void) if (idx == fdt->maxfd) { idx = -(1 + DFS_FD_OFFSET); + dbg_log(DBG_ERROR, "DFS fd new is failed! Could not found an empty fd entry."); goto __result; } diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index 2090a7e363..66740d647e 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -69,6 +69,7 @@ int dfs_register(const struct dfs_filesystem_ops *ops) if (empty == NULL) { rt_set_errno(-ENOSPC); + dbg_log(DBG_ERROR, "There is no space to register this file system (%d).\n", ops->name); ret = -1; } else if (ret == RT_EOK) @@ -317,6 +318,7 @@ int dfs_mount(const char *device_name, if ((fs == NULL) && (iter == &filesystem_table[DFS_FILESYSTEMS_MAX])) { rt_set_errno(-ENOSPC); + dbg_log(DBG_ERROR, "There is no space to mount this file system (%s).\n", filesystemtype); goto err1; } @@ -449,6 +451,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) if (dev_id == NULL) { rt_set_errno(-ENODEV); + dbg_log(DBG_ERROR, "Device (%s) was not found\n", device_name); return -1; } @@ -469,6 +472,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) const struct dfs_filesystem_ops *ops = filesystem_operation_table[index]; if (ops->mkfs == NULL) { + dbg_log(DBG_ERROR, "The file system (%s) mkfs function was not implement\n", fs_name); rt_set_errno(-ENOSYS); return -1; } @@ -476,7 +480,8 @@ int dfs_mkfs(const char *fs_name, const char *device_name) return ops->mkfs(dev_id); } - rt_kprintf("Can not find the file system which named as %s.\n", fs_name); + dbg_log(DBG_ERROR, "File system (%s) was not found.\n", fs_name); + return -1; } |
