]> sourceware.org Git - lvm2.git/commit
Add dm_device_get_name to get map name or block device name for given devno.
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 11 Jan 2012 12:34:44 +0000 (12:34 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 11 Jan 2012 12:34:44 +0000 (12:34 +0000)
commit17c3e42b21f816a2c6d88b9c0c11e40bae28af5d
tree3805a6b3066b0f25b419b1e88d8bb1e601abc5d7
parent2e5ff5d11c362468060df519598f6790f0491ffd
Add dm_device_get_name to get map name or block device name for given devno.

This is accomplished by reading associated sysfs information. For a dm device,
this is /sys/dev/block/major:minor/dm/name (supported in kernel version >= 2.6.29,
for older kernels, the behaviour is the same as for non-dm devices).

For a non-dm device, this is a readlink on /sys/dev/block/major:minor, e.g.
  /sys/dev/block/253:0 --> ../../devices/virtual/block/dm-0.
The last component of the path is a proper kernel name (block device name).

One can request to read only kernel names by setting the 'prefer_kernel_name'
argument if needed.
WHATS_NEW_DM
libdm/libdevmapper.h
libdm/libdm-common.c
This page took 0.032179 seconds and 5 git commands to generate.