Skip to contentSkip to conversation

findmnt: add FSROOT column

PATCH Applied Dave Reisner 2 participants 2 messages Jun 27, 2012 – Jun 28, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 findmnt: add FSROOT column

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.

---
 misc-utils/findmnt.c | 5 +++++
 1 file changed, 5 insertions(+)
misc-utils/findmnt.c +5 -0
index c4cebf8..d7b252a 100644
@@ -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;
 	}
Signature · 1 line
1.7.11.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Dave Reisner
 misc-utils/findmnt.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied, thanks.

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