Commit graph

14 commits

Author SHA1 Message Date
Masatake YAMATO
3c0074005b lsfd: move the code for reading /proc/devices to lsfd.c
The original code is only for reading the names of character device
drivers. For making the code reusable in reading that of block device
drivers, rearrange the code an move it to the common area, lsfd.c.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-12-09 00:35:07 +09:00
Masatake YAMATO
618db96498 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>
2021-10-06 11:01:54 +02:00
Masatake YAMATO
7591516d0e lsfd: add DEVTYPE column
Reflecting the review comment:

    add DEVTYPE for blk, char, and nodev

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:54 +02:00
Masatake YAMATO
6cdc99060a 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 <yamato@redhat.com>
2021-10-06 11:01:54 +02:00
Karel Zak
f9fa97d395 lsfd: cleanup new file initialization
Don't use new_<class>() functions if we have already have
file_class callbacks.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-06 11:01:54 +02:00
Karel Zak
2d95dc093b lsfd: use 'new_' prefix when we allocate something
It's more readable than rather than 'make_'.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-06 11:01:54 +02:00
Masatake YAMATO
63f3938581 lsfd: add MAPLEN column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
a500de3400 lsfd: introduce DEVNAME column and use it as default
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
903b4bec1a lsfd: add MISCDEV column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
e298d0ec93 lsfd: read misc character device names from /proc/misc
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
4e899f5261 lsfd: add CHRDRV column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
12951df22e lsfd: read character driver names from /proc/devices
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
14e16696ff lsfd: move file_class variants after their constructors
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
26508d6325 lsfd: simplify class hierarchy
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Renamed from misc-utils/lsfd-cdev-file.c (Browse further)