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: add FSROOT column
Date: Wed, 27 Jun 2012 09:47:20 -0400	[thread overview]
Message-ID: <1340804840-1666-1-git-send-email-dreisner@archlinux.org> (raw)

Provide this separately in an unambiguous format, mainly to avoid the
need for scripts to parse the source of a btrfs subvol or bind mount.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 misc-utils/findmnt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index c4cebf8..d7b252a 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -78,6 +78,7 @@ enum {
 	COL_AVAIL,
 	COL_USED,
 	COL_USEPERC,
+	COL_FSROOT,
 
 	FINDMNT_NCOLUMNS
 };
@@ -118,6 +119,7 @@ static struct colinfo infos[FINDMNT_NCOLUMNS] = {
 	[COL_AVAIL]        = { "AVAIL",           5, TT_FL_RIGHT, N_("filesystem size available") },
 	[COL_USED]         = { "USED",            5, TT_FL_RIGHT, N_("filesystem size used") },
 	[COL_USEPERC]      = { "USE%",            3, TT_FL_RIGHT, N_("filesystem use percentage") },
+	[COL_FSROOT]       = { "FSROOT",       0.25, TT_FL_NOEXTREMES, N_("filesystem root") },
 };
 
 /* global flags */
@@ -470,6 +472,9 @@ static const char *get_data(struct libmnt_fs *fs, int num)
 	case COL_USEPERC:
 		str = get_vfs_attr(fs, col_id);
 		break;
+	case COL_FSROOT:
+		str = mnt_fs_get_root(fs);
+		break;
 	default:
 		break;
 	}
-- 
1.7.11.1


             reply	other threads:[~2012-06-27 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 13:47 Dave Reisner [this message]
2012-06-28 11:03 ` [PATCH] findmnt: add FSROOT 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=1340804840-1666-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).