From: Karel Zak Date: Thu, 10 Jan 2013 13:59:39 +0000 (+0100) Subject: findmnt: add ID column X-Git-Tag: v2.23-rc1~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9238e0fa33ebc28339c6df80850f93d7c7f11571;p=thirdparty%2Futil-linux.git findmnt: add ID column Signed-off-by: Karel Zak --- diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 96f0177864..758a15e693 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -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; }