]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: rename DEVNAME column to SOURCE
authorMasatake YAMATO <yamato@redhat.com>
Thu, 16 Sep 2021 16:04:48 +0000 (01:04 +0900)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Oct 2021 09:01:54 +0000 (11:01 +0200)
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>
misc-utils/lsfd-bdev.c
misc-utils/lsfd-cdev.c
misc-utils/lsfd-fifo.c
misc-utils/lsfd-file.c
misc-utils/lsfd-sock.c
misc-utils/lsfd-unkn.c
misc-utils/lsfd.c
misc-utils/lsfd.h

index 156bb9420c04cf557fe249c209ca960b15c31ec5..073a58e1ace0af1fdbcfb1409335e3b3453e2572 100644 (file)
@@ -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) {
index c65cfff6c28ef0d43ac2a7b886f36d95dc61faf4..dffe171188155fd2207fa085ba06dd58d6be95eb 100644 (file)
@@ -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)
index 7c1539b6acfaf84349c5ef44fb86eab4ca1c867a..35d8586b72c9b676776fa2f11e66bd446babfd3b 100644 (file)
@@ -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");
index 0005ebf3692db24ca64c9c59366eb1dfcc86addb..12517d41cdc125e52e4e293b60eca9f9411b2a82 100644 (file)
@@ -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) {
index abe48f703940b33629b2d5da9970b43aba95f8e1..495528eb96c49ae2fc142cc85bf35d24b06ef380 100644 (file)
@@ -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");
index 236a31a3693117a86a46d4d9727fb8cce7248f29..4ac4acd8fb311eae22f8e22ff4858d5fb0852af3 100644 (file)
@@ -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");
index 1e877963cd486deb906a91e270e1c9687ca24cf8..93d4135f85c554b1f3e22afdfe7814786a3e3a34 100644 (file)
@@ -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,
index fa077ee1c5e88667b1d1b11db5bcf718adc9ede8..5f4f7d9bc7eba000d53fbdd92563fd0d410fec6f 100644 (file)
@@ -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,