summaryrefslogtreecommitdiffstats
path: root/include/sysfs.h
Commit message (Collapse)AuthorAgeFilesLines
* lib/sysfs: add function to detect partitioned devicesKarel Zak2018-12-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: cleanup function namesKarel Zak2018-06-211-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_blkdev_get_parent()Karel Zak2018-06-211-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/path lib/sysfs: add debugKarel Zak2018-06-211-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add ul_new_sysfs_path() shortcutKarel Zak2018-06-211-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: new implementationKarel Zak2018-06-211-75/+50Star
| | | | | | | | | * reuse ul_path_* API * allow to use prefix for sysfs paths, so we can use snapshots from sysfs for regression tests Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private Stratis devicesTony Asleson2018-03-091-1/+1
| | | | | | | | [kzak@redhat.com: - tiny coding style changes] References: 20e1c3dc03399d6988ef35dedc1364cfc12e9263 Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't use CDROM_GET_CAPABILITY ioctl for DM devicesKarel Zak2017-07-121-1/+1
| | | | | | | | | For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64 add extra warning when the ioctl is used for DM devices. It seems we can avoid this ioctl when the device has dm/uuid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: be more smart for non-scsi devicesKarel Zak2016-06-021-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* lib/sysfs: rename devname functions, cleanupKarel Zak2015-05-281-8/+5Star
| | | | | | | | | | | | | | | | | | Well, I don't have mental power to use function names like sysfs_devname_to_dev_name() so this patch renames to sysfs_devname_sys_to_dev() sysfs_devname_dev_to_sys() It also cleanups usage of the functions. We have to be sure that sysfs.c code returns regular devnames. The existence of the sysfs devnames (with '!') should be completely hidden in sysfs specific code. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: Fix /dev to /sys node name translationStanislav Brabec2015-05-281-1/+19
| | | | | | | | | | | | | | | 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>
* Fix /sys to /dev node name translationStanislav Brabec2015-05-261-0/+18
| | | | | | | | | | | | | | linux/drivers/base/core.c: device_get_devnode() defines a translation of '!' in sysfs nodes to '/' in /dev nodes. The same translation has to be done to properly support device nodes with slash (e. g. device nodes of cciss driver and several other drivers). Introduce new helper sysfs_devname_to_devno() and use it where appropriate. Fixes for example lsblk -f on devices using cciss driver. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* lib/sysfs: add subsystem and hotplug detectionKarel Zak2014-12-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: allow to write to sysfs attributesKarel Zak2014-08-011-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_wholedisk()Karel Zak2014-06-171-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_lvm_private() from libblkidKarel Zak2014-06-171-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add missing values to sysfs_cxt initializer definitionSami Kerola2013-01-241-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/sysfs: add SCSI link functionsKarel Zak2012-10-231-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add functions for SCSI host attributesKarel Zak2012-10-231-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/sysfs: add SCSI host:channel:target:lun supportKarel Zak2012-10-231-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs; add sysfs_partno_to_devno()Karel Zak2012-08-131-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: use warn_unused_result for sysfs_init()Karel Zak2012-06-211-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sysfs: move blkid_devno_to_wholedisk to sysfs_devno_to_wholediskMichal Luscon2012-03-271-0/+2
| | | | Signed-off-by: Michal Luscon <mluscon@redhat.com>
* libblkid: fix sysfs context usageKarel Zak2012-03-061-0/+1
| | | | | Reported-by: Elan Ruusamäe <glen@delfi.ee> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix 'make checkincludes' warningsKarel Zak2011-07-281-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [sysfs.c] add sysfs_readlink and name/path functionsKarel Zak2011-05-181-2/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [sysfs.c] make sysfs_read_* function more robustKarel Zak2011-05-181-3/+5
| | | | | | | The functions does not modify result if the requested sysfs attribute does not exist. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use stuff from sysfs.h and at.hKarel Zak2011-05-161-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add generic sysfs utilsKarel Zak2011-05-161-0/+57
Signed-off-by: Karel Zak <kzak@redhat.com>