summaryrefslogtreecommitdiffstats
path: root/misc-utils/lsblk-devtree.c
Commit message (Collapse)AuthorAgeFilesLines
* lsblk: fix -E segfaultKarel Zak2019-07-151-0/+2
| | | | | | | | We need to check if referenced wholedisk defines the de-duplication key... Addresses: https://github.com/karelzak/util-linux/issues/819 Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: fix null pointer dereferencesSami Kerola2018-12-101-1/+2
| | | | | | Both catched with -Wnull-dereference compiler option: Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lsblk: add --mergeKarel Zak2018-12-071-1/+33
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: make devtree dependences more genericKarel Zak2018-12-071-26/+60
| | | | | | | We also need reference from child to parent to implement multi-parent view. This change allows to walk on tree in both directions. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add --dedup <column>Karel Zak2018-12-071-9/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The target use-case are systems with large number of multi-path devices or systems with duplicate (copied) filesystems. The feature is flexible enough to use arbitrary column (for example WWM or UUID, ...) as de-duplication key. For example tree with multi-path devices sd{c,d,e,f} ./lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk ├─sda1 8:1 0 200M 0 part /boot/efi ├─sda2 8:2 0 200M 0 part /boot ├─sda3 8:3 0 130.3G 0 part ├─sda4 8:4 0 50G 0 part / └─sda5 8:5 0 42.9G 0 part sdb 8:16 0 74.5G 0 disk └─sdb1 8:17 0 74.5G 0 part /home/archive sdc 8:32 0 100M 0 disk └─mpatha 253:0 0 100M 0 mpath ├─mpatha1 253:1 0 50M 0 part └─mpatha2 253:2 0 49M 0 part sdd 8:48 0 100M 0 disk └─mpatha 253:0 0 100M 0 mpath ├─mpatha1 253:1 0 50M 0 part └─mpatha2 253:2 0 49M 0 part sde 8:64 0 100M 0 disk └─mpatha 253:0 0 100M 0 mpath ├─mpatha1 253:1 0 50M 0 part └─mpatha2 253:2 0 49M 0 part sdf 8:80 0 100M 0 disk └─mpatha 253:0 0 100M 0 mpath ├─mpatha1 253:1 0 50M 0 part └─mpatha2 253:2 0 49M 0 part De-duplicate by WWN: ./lsblk -M WWN NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk ├─sda1 8:1 0 200M 0 part /boot/efi ├─sda2 8:2 0 200M 0 part /boot ├─sda3 8:3 0 130.3G 0 part ├─sda4 8:4 0 50G 0 part / └─sda5 8:5 0 42.9G 0 part sdb 8:16 0 74.5G 0 disk └─sdb1 8:17 0 74.5G 0 part /home/archive sdc 8:32 0 100M 0 disk └─mpatha 253:0 0 100M 0 mpath ├─mpatha1 253:1 0 50M 0 part └─mpatha2 253:2 0 49M 0 part Addresses: https://github.com/karelzak/util-linux/issues/616 Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: remember whole-disk, remove unused struct memberKarel Zak2018-12-071-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: read queue/discard_granularity only when necessaryKarel Zak2018-12-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: reuse 'removable' flag from parentKarel Zak2018-12-071-1/+1
| | | | | | | It's used in the default output, let's make it a little bit more effective. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add lsblk_device_has_dependence()Karel Zak2018-12-071-10/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: fix devtree deallocationKarel Zak2018-12-071-13/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: cleanup device reference in the treeKarel Zak2018-12-071-3/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add basic function to build devices treeKarel Zak2018-12-071-0/+257
Signed-off-by: Karel Zak <kzak@redhat.com>