]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: add FSROOT column
authorDave Reisner <dreisner@archlinux.org>
Wed, 27 Jun 2012 13:47:20 +0000 (09:47 -0400)
committerKarel Zak <kzak@redhat.com>
Thu, 28 Jun 2012 10:59:57 +0000 (12:59 +0200)
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

index c4cebf8fa24527da32815edf12ad145a213973bb..d7b252a8b85a0e1deefcfa45cfaaf635627e9f61 100644 (file)
@@ -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;
        }