findmnt: use st.st_bavail for available column
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.
Signed-off-by Dave Reisner <[email protected]>
--- misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc-utils/findmnt.c +1 -1
@@ -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
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