summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-12-13 02:13:34 +0000
committer[email protected] <[email protected]>2012-12-13 02:13:34 +0000
commit56ab153b1c92ccfc3695adf9fe8bef3e5230369d (patch)
tree80610849d83ea1332e61619acd4420da74b507ad /components/dfs/src
parentd8796d9639bb6e9e2c5d5a7cf4d54623ed905b93 (diff)
update dfs to support NFTL
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2478 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs_fs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c
index 7c319722cd..f747617e5f 100644
--- a/components/dfs/src/dfs_fs.c
+++ b/components/dfs/src/dfs_fs.c
@@ -400,7 +400,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
{
int index;
- /* lock filesystem */
+ /* lock file system */
dfs_lock();
/* find the file system operations */
for (index = 0; index < DFS_FILESYSTEM_TYPES_MAX; index++)
@@ -420,6 +420,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
}
dfs_unlock();
+ rt_kprintf("Can not find the file system which named as %s.\n", fs_name);
return -1;
}
@@ -455,9 +456,15 @@ FINSH_FUNCTION_EXPORT(mkfs, make a file system);
void df(const char *path)
{
+ int result;
struct statfs buffer;
- if (dfs_statfs(path, &buffer) == 0)
+ if (path == RT_NULL)
+ result = dfs_statfs("/", &buffer);
+ else
+ result = dfs_statfs(path, &buffer);
+
+ if (result == 0)
{
rt_kprintf("disk free: %d block[%d bytes per block]\n", buffer.f_bfree, buffer.f_bsize);
}