提交 d883f7e2 编写于 作者: L lizhen9880

fix the f_bsize and f_blocks issue in function dfs_uffs_statfs

上级 3e6f64fe
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* 2011-10-22 prife the first version * 2011-10-22 prife the first version
* 2012-03-28 prife use mtd device interface * 2012-03-28 prife use mtd device interface
* 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount * 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount
* 2017-04-12 lizhen9880 fix the f_bsize and f_blocks issue in function dfs_uffs_statfs
*/ */
#include <rtthread.h> #include <rtthread.h>
...@@ -278,10 +279,9 @@ static int dfs_uffs_statfs(struct dfs_filesystem* fs, ...@@ -278,10 +279,9 @@ static int dfs_uffs_statfs(struct dfs_filesystem* fs,
if (index == UFFS_DEVICE_MAX) if (index == UFFS_DEVICE_MAX)
return -DFS_STATUS_ENOENT; return -DFS_STATUS_ENOENT;
buf->f_bsize = mtd->page_size; buf->f_bsize = mtd->page_size*mtd->pages_per_block;
buf->f_blocks = mtd->pages_per_block* buf->f_blocks = (mtd->block_end - mtd->block_start + 1);
(mtd->block_end - mtd->block_start + 1); buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev)/buf->f_bsize ;
buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev) / mtd->page_size;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册