]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: add ID column
authorKarel Zak <kzak@redhat.com>
Thu, 10 Jan 2013 13:59:39 +0000 (14:59 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 10 Jan 2013 13:59:39 +0000 (14:59 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/findmnt.c

index 96f01778645ba7b1aad1ab0583b3fac81e720c8f..758a15e693d1f7eb5bcbea13051e6f8430813194 100644 (file)
@@ -80,6 +80,7 @@ enum {
        COL_USEPERC,
        COL_FSROOT,
        COL_TID,
+       COL_ID,
        COL_OPT_FIELDS,
 
        FINDMNT_NCOLUMNS
@@ -123,6 +124,7 @@ static struct colinfo infos[FINDMNT_NCOLUMNS] = {
        [COL_USEPERC]      = { "USE%",            3, TT_FL_RIGHT, N_("filesystem use percentage") },
        [COL_FSROOT]       = { "FSROOT",       0.25, TT_FL_NOEXTREMES, N_("filesystem root") },
        [COL_TID]          = { "TID",             4, TT_FL_RIGHT, N_("task ID") },
+       [COL_ID]           = { "ID",              2, TT_FL_RIGHT, N_("mount ID") },
        [COL_OPT_FIELDS]   = { "OPT-FIELDS",   0.10, TT_FL_TRUNC, N_("optional mount fields") },
 };
 
@@ -484,6 +486,12 @@ static const char *get_data(struct libmnt_fs *fs, int num)
                        str = tmp;
                }
                break;
+       case COL_ID:
+               if (mnt_fs_get_id(fs)) {
+                       xasprintf(&tmp, "%d", mnt_fs_get_id(fs));
+                       str = tmp;
+               }
+               break;
        default:
                break;
        }