linux/Documentation/ABI/testing
Dan Williams e105b8bfc7 sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor
Why?:
There are occasions where userspace would like to access sysfs
attributes for a device but it may not know how sysfs has named the
device or the path.  For example what is the sysfs path for
/dev/disk/by-id/ata-ST3160827AS_5MT004CK?  With this change a call to
stat(2) returns the major:minor then userspace can see that
/sys/dev/block/8:32 links to /sys/block/sdc.

What are the alternatives?:
1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
   the need to proliferate ioctl interfaces into the kernel, so this
   seems counter productive.

2/ Use udev to create these symlinks: Also doable, but it adds a
   udev dependency to utilities that might be running in a limited
   environment like an initramfs.

3/ Do a full-tree search of sysfs.

[kay.sievers@vrfy.org: fix duplicate registrations]
[kay.sievers@vrfy.org: cleanup suggestions]

Cc: Neil Brown <neilb@suse.de>
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Reviewed-by: SL Baur <steve@xemacs.org>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Mark Lord <lkml@rtr.ca>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:54:40 -07:00
..
debugfs-pktcdvd [PATCH] pktcdvd: cleanup 2007-02-11 10:51:28 -08:00
procfs-diskstats Enhanced partition statistics: documentation update 2008-02-08 12:42:11 +01:00
sysfs-block block: Data integrity infrastructure documentation 2008-07-03 13:21:13 +02:00
sysfs-bus-css [S390] cio: Introduce modalias for css bus. 2008-07-14 10:02:05 +02:00
sysfs-bus-pci PCI: Expose PCI VPD through sysfs 2008-04-20 21:47:07 -07:00
sysfs-bus-usb USB: Add documentation for USB suspend statistics. 2008-02-01 14:35:00 -08:00
sysfs-class [PATCH] Add kernel<->userspace ABI stability documentation 2006-06-21 12:40:47 -07:00
sysfs-class-bdi fuse: fix bdi naming conflict 2008-05-24 09:56:07 -07:00
sysfs-class-pktcdvd [PATCH] pktcdvd: cleanup 2007-02-11 10:51:28 -08:00
sysfs-dev sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor 2008-07-21 21:54:40 -07:00
sysfs-devices [PATCH] Add kernel<->userspace ABI stability documentation 2006-06-21 12:40:47 -07:00
sysfs-firmware-acpi ACPI: Enhance /sys/firmware/interrupts to allow enable/disable/clear from user-space 2008-07-16 23:27:04 +02:00
sysfs-firmware-memmap sysfs: add /sys/firmware/memmap 2008-07-08 17:55:41 +02:00
sysfs-ibft Firmware: add iSCSI iBFT Support 2008-04-19 19:10:28 -07:00
sysfs-kernel-uids Documentation: create new scheduler/ subdirectory 2008-02-07 08:42:17 -08:00
sysfs-ocfs2 ocfs2: Document /sys/fs/ocfs2 2008-04-18 08:56:07 -07:00
sysfs-power [PATCH] swsusp: debugging 2006-11-03 12:27:58 -08:00