fix bugs in uffs_result_to_dfs and in dfs_uffs_statfs in dfs_uffs.c

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2025 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
goprife@gmail.com 2012-04-08 11:28:51 +00:00
parent 95bcaa08d5
commit 0bcb79b3ab
1 changed files with 2 additions and 1 deletions

View File

@ -48,6 +48,7 @@ static int uffs_result_to_dfs(int result)
{
int status = -1;
result = result < 0 ? -result : result;
switch (result)
{
case UENOERR:/** no error */
@ -270,7 +271,7 @@ static int dfs_uffs_statfs(struct dfs_filesystem* fs,
buf->f_bsize = mtd->page_size;
buf->f_blocks = (mtd->block_size)/(mtd->page_size)*
(mtd->block_start - mtd->block_end + 1);
(mtd->block_end - mtd->block_start + 1);
buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev) / mtd->page_size;
return 0;