util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] findmnt: add FSROOT column
@ 2012-06-27 13:47 Dave Reisner
  2012-06-28 11:03 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Reisner @ 2012-06-27 13:47 UTC (permalink / raw)
  To: util-linux; +Cc: Dave Reisner

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] findmnt: add FSROOT column
  2012-06-27 13:47 [PATCH] findmnt: add FSROOT column Dave Reisner
@ 2012-06-28 11:03 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2012-06-28 11:03 UTC (permalink / raw)
  To: Dave Reisner; +Cc: util-linux

On Wed, Jun 27, 2012 at 09:47:20AM -0400, Dave Reisner wrote:
>  misc-utils/findmnt.c | 5 +++++
>  1 file changed, 5 insertions(+)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-28 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27 13:47 [PATCH] findmnt: add FSROOT column Dave Reisner
2012-06-28 11:03 ` Karel Zak

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).