提交 6139e6a3 编写于 作者: armink_ztl's avatar armink_ztl

[dfs] Update error log for dfs.

上级 c698c2c8
...@@ -197,6 +197,7 @@ int fd_new(void) ...@@ -197,6 +197,7 @@ int fd_new(void)
if (idx == fdt->maxfd) if (idx == fdt->maxfd)
{ {
idx = -(1 + DFS_FD_OFFSET); idx = -(1 + DFS_FD_OFFSET);
dbg_log(DBG_ERROR, "DFS fd new is failed! Could not found an empty fd entry.");
goto __result; goto __result;
} }
......
...@@ -69,6 +69,7 @@ int dfs_register(const struct dfs_filesystem_ops *ops) ...@@ -69,6 +69,7 @@ int dfs_register(const struct dfs_filesystem_ops *ops)
if (empty == NULL) if (empty == NULL)
{ {
rt_set_errno(-ENOSPC); rt_set_errno(-ENOSPC);
dbg_log(DBG_ERROR, "There is no space to register this file system (%d).\n", ops->name);
ret = -1; ret = -1;
} }
else if (ret == RT_EOK) else if (ret == RT_EOK)
...@@ -317,6 +318,7 @@ int dfs_mount(const char *device_name, ...@@ -317,6 +318,7 @@ int dfs_mount(const char *device_name,
if ((fs == NULL) && (iter == &filesystem_table[DFS_FILESYSTEMS_MAX])) if ((fs == NULL) && (iter == &filesystem_table[DFS_FILESYSTEMS_MAX]))
{ {
rt_set_errno(-ENOSPC); rt_set_errno(-ENOSPC);
dbg_log(DBG_ERROR, "There is no space to mount this file system (%s).\n", filesystemtype);
goto err1; goto err1;
} }
...@@ -449,6 +451,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) ...@@ -449,6 +451,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
if (dev_id == NULL) if (dev_id == NULL)
{ {
rt_set_errno(-ENODEV); rt_set_errno(-ENODEV);
dbg_log(DBG_ERROR, "Device (%s) was not found\n", device_name);
return -1; return -1;
} }
...@@ -469,6 +472,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) ...@@ -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]; const struct dfs_filesystem_ops *ops = filesystem_operation_table[index];
if (ops->mkfs == NULL) if (ops->mkfs == NULL)
{ {
dbg_log(DBG_ERROR, "The file system (%s) mkfs function was not implement\n", fs_name);
rt_set_errno(-ENOSYS); rt_set_errno(-ENOSYS);
return -1; return -1;
} }
...@@ -476,7 +480,8 @@ int dfs_mkfs(const char *fs_name, const char *device_name) ...@@ -476,7 +480,8 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
return ops->mkfs(dev_id); 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; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册