From: Masatake YAMATO Date: Thu, 16 Sep 2021 15:01:30 +0000 (+0900) Subject: lsfd: rename the column DEVICE to MAJ:MIN X-Git-Tag: v2.38-rc1~144^2~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cdc99060a87428f0b74026ff89600fb4c1a12be;p=thirdparty%2Futil-linux.git lsfd: rename the column DEVICE to MAJ:MIN Reflecting the review comment: add MAJ:MIN for major and minor numbers, remove DEVICE (we use MAJ:MIN in other tools) Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-bdev.c b/misc-utils/lsfd-bdev.c index e640a0d39e..928b1e3bda 100644 --- a/misc-utils/lsfd-bdev.c +++ b/misc-utils/lsfd-bdev.c @@ -55,7 +55,7 @@ static bool bdev_fill_column(struct proc *proc __attribute__((__unused__)), break; } /* FALL THROUGH */ - case COL_DEVICE: + case COL_MAJMIN: xasprintf(&str, "%u:%u", major(file->stat.st_rdev), minor(file->stat.st_rdev)); diff --git a/misc-utils/lsfd-cdev.c b/misc-utils/lsfd-cdev.c index c56123110d..5344c29892 100644 --- a/misc-utils/lsfd-cdev.c +++ b/misc-utils/lsfd-cdev.c @@ -90,7 +90,7 @@ static bool cdev_fill_column(struct proc *proc __attribute__((__unused__)), break; } /* FALL THROUGH */ - case COL_DEVICE: + case COL_MAJMIN: xasprintf(&str, "%u:%u", major(file->stat.st_rdev), minor(file->stat.st_rdev)); diff --git a/misc-utils/lsfd-file.c b/misc-utils/lsfd-file.c index 0fd4f54da0..d9a7a19001 100644 --- a/misc-utils/lsfd-file.c +++ b/misc-utils/lsfd-file.c @@ -241,7 +241,7 @@ static bool file_fill_column(struct proc *proc, } /* FALL THROUGH */ case COL_DEV: - case COL_DEVICE: + case COL_MAJMIN: xasprintf(&str, "%u:%u", major(file->stat.st_dev), minor(file->stat.st_dev)); diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index bee064ea35..3a7f5c89b2 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -107,8 +107,6 @@ static struct colinfo infos[] = { N_("reachability from the file system") }, [COL_DEV] = { "DEV", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, N_("ID of device containing file") }, - [COL_DEVICE] = { "DEVICE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, - N_("device ID for special, or ID of device containing file") }, [COL_DEVNAME] = { "DEVNAME", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, N_("device name, decoded version of DEVICE") }, [COL_FLAGS] = { "FLAGS", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, @@ -117,6 +115,8 @@ static struct colinfo infos[] = { N_("file descriptor for the file") }, [COL_INODE] = { "INODE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, N_("inode number") }, + [COL_MAJMIN] = { "MAJ:MIN", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, + N_("device ID for special, or ID of device containing file") }, [COL_MAPLEN] = { "MAPLEN", 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, N_("length of file mapping (in page)") }, [COL_MISCDEV] = { "MISCDEV", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index 178ca3396d..c1b791d838 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -44,12 +44,12 @@ enum { COL_CHRDRV, COL_COMMAND, COL_DELETED, - COL_DEVICE, COL_DEVNAME, COL_DEV, COL_FD, COL_FLAGS, COL_INODE, + COL_MAJMIN, COL_MAPLEN, COL_MISCDEV, COL_MNT_ID,