util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Reisner <dreisner@archlinux.org>
To: util-linux@vger.kernel.org
Cc: Dave Reisner <dreisner@archlinux.org>
Subject: [PATCH] findmnt: use st.st_bavail for available column
Date: Mon, 20 Aug 2012 06:06:17 -0400	[thread overview]
Message-ID: <1345457177-4072-1-git-send-email-dreisner@archlinux.org> (raw)

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 <dreisner@archlinux.org>
---
 misc-utils/findmnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index db40323..853fae0 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -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);
-- 
1.7.11.5


             reply	other threads:[~2012-08-20 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-20 10:06 Dave Reisner [this message]
2012-09-04 10:44 ` [PATCH] findmnt: use st.st_bavail for available column Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345457177-4072-1-git-send-email-dreisner@archlinux.org \
    --to=dreisner@archlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).