Skip to contentSkip to conversation

findmnt: use st.st_bavail for available column

PATCH Applied Dave Reisner 2 participants 2 messages Aug 20, 2012 – Sep 4, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 findmnt: use st.st_bavail for available column

This matches more closely with what 'df -h' reports as space available. Any remaining discrepancy between these 2 tools is a result of precision and choices in rounding.

---
 misc-utils/findmnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
misc-utils/findmnt.c +1 -1
index db40323..853fae0 100644
@@ -374,7 +374,7 @@ static const char *get_vfs_attr(struct libmnt_fs *fs, int sizetype)
 		vfs_attr = buf.f_frsize * buf.f_blocks;
 		break;
 	case COL_AVAIL:
-		vfs_attr = buf.f_frsize * buf.f_bfree;
+		vfs_attr = buf.f_frsize * buf.f_bavail;
 		break;
 	case COL_USED:
 		vfs_attr = buf.f_frsize * (buf.f_blocks - buf.f_bfree);
Signature · 1 line
1.7.11.5
maintainer Applied
#1 lore raw
Quoted 2 lines · Dave Reisner
 misc-utils/findmnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com