Browse Source

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 <yamato@redhat.com>
pull/1487/head
Masatake YAMATO 11 months ago committed by Karel Zak
parent
commit
618db96498
  1. 2
      misc-utils/lsfd-bdev.c
  2. 2
      misc-utils/lsfd-cdev.c
  3. 2
      misc-utils/lsfd-fifo.c
  4. 2
      misc-utils/lsfd-file.c
  5. 2
      misc-utils/lsfd-sock.c
  6. 2
      misc-utils/lsfd-unkn.c
  7. 8
      misc-utils/lsfd.c
  8. 2
      misc-utils/lsfd.h

2
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) {

2
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)

2
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");

2
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) {

2
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");

2
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");

8
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,

2
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,

Loading…
Cancel
Save