You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by li...@apache.org on 2024/10/11 02:42:29 UTC
(nuttx) 03/13: romfs:bugfix romfs_statfs
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 3e58620ccc4349a8199aad5b50aab3e811a05cb9
Author: guohao15 <gu...@xiaomi.com>
AuthorDate: Fri Apr 26 23:11:55 2024 +0800
romfs:bugfix romfs_statfs
fix for df cmd infomation of romfs
Signed-off-by: guohao15 <gu...@xiaomi.com>
---
fs/romfs/fs_romfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c
index 25f6f6deda..4797f7b2cd 100644
--- a/fs/romfs/fs_romfs.c
+++ b/fs/romfs/fs_romfs.c
@@ -1298,8 +1298,9 @@ static int romfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf)
/* Everything else follows in units of sectors */
- buf->f_blocks = SEC_NSECTORS(rm, rm->rm_volsize + SEC_NDXMASK(rm));
- buf->f_bfree = rm->rm_hwnsectors - buf->f_blocks;
+ buf->f_blocks = rm->rm_hwnsectors;
+ buf->f_bfree = buf->f_blocks -
+ SEC_NSECTORS(rm, rm->rm_volsize + SEC_NDXMASK(rm));
buf->f_bavail = buf->f_bfree;
buf->f_namelen = NAME_MAX;