From 618db964984490af613c90c4d6e584090e1298c4 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 17 Sep 2021 01:04:48 +0900 Subject: [PATCH] lsfd: rename DEVNAME column to SOURCE Reflecting the review comment: maybe rename DEVNAME to SOURCE as we have here things like 'devtmpfs' etc. Signed-off-by: Masatake YAMATO --- misc-utils/lsfd-bdev.c | 2 +- misc-utils/lsfd-cdev.c | 2 +- misc-utils/lsfd-fifo.c | 2 +- misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd-sock.c | 2 +- misc-utils/lsfd-unkn.c | 2 +- misc-utils/lsfd.c | 8 ++++---- misc-utils/lsfd.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/misc-utils/lsfd-bdev.c b/misc-utils/lsfd-bdev.c index 156bb9420c..073a58e1ac 100644 --- a/misc-utils/lsfd-bdev.c +++ b/misc-utils/lsfd-bdev.c @@ -52,7 +52,7 @@ static bool bdev_fill_column(struct proc *proc __attribute__((__unused__)), "blk")) err(EXIT_FAILURE, _("failed to add output data")); return true; - case COL_DEVNAME: + case COL_SOURCE: case COL_PARTITION: partition = get_partition(file->stat.st_rdev); if (partition) { diff --git a/misc-utils/lsfd-cdev.c b/misc-utils/lsfd-cdev.c index c65cfff6c2..dffe171188 100644 --- a/misc-utils/lsfd-cdev.c +++ b/misc-utils/lsfd-cdev.c @@ -80,7 +80,7 @@ static bool cdev_fill_column(struct proc *proc __attribute__((__unused__)), xasprintf(&str, "%u", major(file->stat.st_rdev)); break; - case COL_DEVNAME: + case COL_SOURCE: chrdrv = get_chrdrv(major(file->stat.st_rdev)); miscdev = NULL; if (chrdrv && strcmp(chrdrv, "misc") == 0) diff --git a/misc-utils/lsfd-fifo.c b/misc-utils/lsfd-fifo.c index 7c1539b6ac..35d8586b72 100644 --- a/misc-utils/lsfd-fifo.c +++ b/misc-utils/lsfd-fifo.c @@ -38,7 +38,7 @@ static bool fifo_fill_column(struct proc *proc __attribute__((__unused__)), if (scols_line_set_data(ln, column_index, "FIFO")) err(EXIT_FAILURE, _("failed to add output data")); return true; - case COL_DEVNAME: + case COL_SOURCE: if (major(file->stat.st_dev) == 0 && strncmp(file->name, "pipe:", 5) == 0) { str = strdup("pipefs"); diff --git a/misc-utils/lsfd-file.c b/misc-utils/lsfd-file.c index 0005ebf369..12517d41cd 100644 --- a/misc-utils/lsfd-file.c +++ b/misc-utils/lsfd-file.c @@ -229,7 +229,7 @@ static bool file_fill_column(struct proc *proc, case COL_INODE: xasprintf(&str, "%llu", (unsigned long long)file->stat.st_ino); break; - case COL_DEVNAME: + case COL_SOURCE: if (major(file->stat.st_dev) == 0) { const char *filesystem = get_nodev_filesystem(minor(file->stat.st_dev)); if (filesystem) { diff --git a/misc-utils/lsfd-sock.c b/misc-utils/lsfd-sock.c index abe48f7039..495528eb96 100644 --- a/misc-utils/lsfd-sock.c +++ b/misc-utils/lsfd-sock.c @@ -58,7 +58,7 @@ static bool sock_fill_column(struct proc *proc __attribute__((__unused__)), break; } return false; - case COL_DEVNAME: + case COL_SOURCE: if (major(file->stat.st_dev) == 0 && strncmp(file->name, "socket:", 7) == 0) { str = strdup("sockfs"); diff --git a/misc-utils/lsfd-unkn.c b/misc-utils/lsfd-unkn.c index 236a31a369..4ac4acd8fb 100644 --- a/misc-utils/lsfd-unkn.c +++ b/misc-utils/lsfd-unkn.c @@ -38,7 +38,7 @@ static bool unkn_fill_column(struct proc *proc __attribute__((__unused__)), if (scols_line_set_data(ln, column_index, "UNKN")) err(EXIT_FAILURE, _("failed to add output data")); return true; - case COL_DEVNAME: + case COL_SOURCE: if (major(file->stat.st_dev) == 0 && strncmp(file->name, "anon_inode:", 11) == 0) { str = strdup("anon_inodefs"); diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index 1e877963cd..93d4135f85 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_DEVNAME] = { "DEVNAME", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, - N_("device name, decoded version of DEVICE") }, [COL_DEVTYPE] = { "DEVTYPE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, N_("device type (blk, char, or nodev") }, [COL_FLAGS] = { "FLAGS", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, @@ -143,6 +141,8 @@ static struct colinfo infos[] = { N_("device ID (if special file)") }, [COL_SIZE] = { "SIZE", 4, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, N_("file size"), }, + [COL_SOURCE] = { "SOURCE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, + N_("file system, partition, or device containing file") }, [COL_TID] = { "TID", 5, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, N_("thread ID of the process opening the file") }, [COL_TYPE] = { "TYPE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, @@ -160,7 +160,7 @@ static const int default_columns[] = { COL_ASSOC, COL_MODE, COL_TYPE, - COL_DEVNAME, + COL_SOURCE, COL_MNT_ID, COL_INODE, COL_NAME, @@ -174,7 +174,7 @@ static const int default_threads_columns[] = { COL_ASSOC, COL_MODE, COL_TYPE, - COL_DEVNAME, + COL_SOURCE, COL_MNT_ID, COL_INODE, COL_NAME, diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index fa077ee1c5..5f4f7d9bc7 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -45,7 +45,6 @@ enum { COL_COMMAND, COL_DELETED, COL_DEV, - COL_DEVNAME, COL_DEVTYPE, COL_FD, COL_FLAGS, @@ -63,6 +62,7 @@ enum { COL_PROTONAME, COL_RDEV, COL_SIZE, + COL_SOURCE, COL_TID, COL_TYPE, COL_UID, -- 2.47.3