linux/Documentation/filesystems
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
..
configfs configfs: Allow ->make_item() and ->make_group() to return detailed errors. 2008-07-17 15:21:29 -07:00
00-INDEX
9p.txt
Exporting
Locking [PATCH] kill ->put_inode 2008-05-06 13:45:34 -04:00
adfs.txt
affs.txt
afs.txt
automount-support.txt
befs.txt
bfs.txt
cifs.txt
coda.txt
cramfs.txt
dentry-locking.txt
directory-locking
dlmfs.txt
dnotify.txt
ecryptfs.txt
ext2.txt
ext3.txt
ext4.txt ext4: Documention update for new ordered mode and delayed allocation 2008-07-11 19:27:31 -04:00
files.txt
fuse.txt
gfs2-glocks.txt [GFS2] Glock documentation 2008-06-27 09:39:53 +01:00
gfs2.txt
hfs.txt
hfsplus.txt
hpfs.txt
inotify.txt
isofs.txt
jfs.txt
locks.txt
mandatory-locking.txt
ncpfs.txt
nfs-rdma.txt nfs: rewrap NFS/RDMA documentation to 80 lines 2008-06-30 15:24:43 -04:00
nfsroot.txt
ntfs.txt
ocfs2.txt
porting
proc.txt genirq: Expose default irq affinity mask (take 3) 2008-06-05 15:18:30 +02:00
quota.txt
ramfs-rootfs-initramfs.txt
relay.txt
romfs.txt
rpc-cache.txt
seq_file.txt
sharedsubtree.txt
smbfs.txt
spufs.txt
sysfs-pci.txt x86: PAT export resource_wc in pci sysfs 2008-06-12 10:12:42 +02:00
sysfs.txt sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor 2008-07-21 21:54:40 -07:00
sysv-fs.txt
tmpfs.txt
ubifs.txt UBIFS: add brief documentation 2008-07-15 09:22:12 +03:00
udf.txt
ufs.txt
vfat.txt
vfs.txt [PATCH] kill ->put_inode 2008-05-06 13:45:34 -04:00
xfs.txt
xip.txt