]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/sysfs: Fix /dev to /sys node name translation
authorStanislav Brabec <sbrabec@suse.cz>
Wed, 27 May 2015 13:12:08 +0000 (15:12 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 28 May 2015 08:27:20 +0000 (10:27 +0200)
commit759b120d85c30ec6ab80097c251677b022c5a03c
treedf154e7b72c222b67b3bfc6bcd275fdff7e82ea5
parent97c68d42041bb8761568f988b27cbfc470f6fb7d
lib/sysfs: Fix /dev to /sys node name translation

d0dc6c1 introduced translation of /sys names to /dev names, as required
by the kernel linux/drivers/base/core.c: device_get_devnode(). But there
are other places of code that use /dev names in /sys. They need reverse
translation from '/' to '!'.

For example, fdisk -l returns empty list since a22c6eb for device nodes
in subdirectories (used e. g. by cciss driver).

Introduce yet another helper sysfs_dev_name_to_devname() and use it where
appropriate.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
include/sysfs.h
lib/sysfs.c