lsns: print namespace tree based on the relationship (parent/child or owner/owned)
Introduce new option -T[parent|owner]|--nstree[=parent|=owner].
With this change, lsns prints parent/child relationship tree if
"-T parent" is given and owner/owned relationship tree if "-T owner is given.
Passing only "-T" is same as passing "-Towner."
Example sessions:
# ./lsns -Tparent -ons,type,pns| head -20
NS TYPE PNS
4026531837 user 0
├─
4026532508 user
4026531837
├─
4026532609 user
4026531837
├─
4026532610 user
4026531837
├─
4026532629 user
4026531837
├─
4026532705 user
4026531837
├─
4026532901 user
4026531837
├─
4026533090 user
4026531837
├─
4026533185 user
4026531837
├─
4026533280 user
4026531837
└─
4026533468 user
4026531837
4026531835 cgroup 0
4026531836 pid 0
└─
4026533038 pid
4026531836
├─
4026532934 pid
4026533038
├─
4026533715 pid
4026533038
├─
4026533716 pid
4026533038
...
# ./lsns -Towner -ons,type,ons| head -20
NS TYPE ONS
4026531837 user 0
├─
4026531835 cgroup
4026531837
├─
4026531836 pid
4026531837
├─
4026531838 uts
4026531837
├─
4026531839 ipc
4026531837
├─
4026531840 mnt
4026531837
├─
4026531861 mnt
4026531837
├─
4026532001 net
4026531837
├─
4026532219 mnt
4026531837
├─
4026532357 mnt
4026531837
├─
4026532383 net
4026531837
├─
4026532475 mnt
4026531837
├─
4026532476 mnt
4026531837
├─
4026532504 mnt
4026531837
├─
4026532508 user
4026531837
│ ├─
4026532509 ipc
4026532508
│ └─
4026532511 net
4026532508
├─
4026532573 mnt
4026531837
├─
4026532574 mnt
4026531837
Signed-off-by: Masatake YAMATO <yamato@redhat.com>