linux-stable/include
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
..
acpi Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-16 17:25:46 -07:00
asm-alpha
asm-arm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc 2008-07-16 15:17:52 -07:00
asm-avr32 termios: Termios defines for other platforms 2008-07-20 17:12:38 -07:00
asm-blackfin
asm-cris
asm-frv termios: Termios defines for other platforms 2008-07-20 17:12:38 -07:00
asm-generic Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-16 17:25:46 -07:00
asm-h8300
asm-ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2008-07-21 14:55:23 -07:00
asm-m32r
asm-m68k m68k: remove stale ARCH_SUN4 #define 2008-07-20 17:24:39 -07:00
asm-m68knommu
asm-mips [MIPS] Remove unused maltasmp.h. 2008-07-20 14:38:22 +01:00
asm-mn10300
asm-parisc
asm-powerpc KVM: Add coalesced MMIO support (powerpc part) 2008-07-20 12:42:31 +03:00
asm-s390 KVM: s390: rename private structures 2008-07-20 12:42:37 +03:00
asm-sh
asm-sparc sparc64: Add missing hypervisor service group numbers. 2008-07-18 00:43:52 -07:00
asm-sparc64 sparc: join the remaining header files 2008-07-17 21:55:51 -07:00
asm-um
asm-v850
asm-x86 x86: convert Dprintk to pr_debug 2008-07-21 21:35:38 +02:00
asm-xtensa
crypto
drm drm/radeon: fixup issue with radeon and PAT support. 2008-07-15 15:48:05 +10:00
keys
linux sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor 2008-07-21 21:54:40 -07:00
math-emu
media V4L/DVB (8395): saa7134: Fix Kbuild dependency of ir-kbd-i2c 2008-07-20 07:29:03 -03:00
mtd
net netfilter: accounting rework: ct_extend + 64bit counters (v4) 2008-07-21 10:10:58 -07:00
pcmcia
rdma RDMA/addr: Keep pointer to netdevice in struct rdma_dev_addr 2008-07-14 23:48:53 -07:00
rxrpc
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
sound ALSA: Release v1.0.17 2008-07-14 09:54:43 +02:00
video
xen xen: implement Xen-specific spinlocks 2008-07-16 11:15:53 +02:00
Kbuild drm: reorganise drm tree to be more future proof. 2008-07-14 10:45:01 +10:00