]> git.baikalelectronics.ru Git - kernel.git/commit
sysfs: create optimal relative symlink targets
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 1 Nov 2007 19:20:52 +0000 (20:20 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:08 +0000 (20:40 -0800)
commitacfa3e4ed3c505f2a8152380fd8aae5d061bacf2
tree70f8947025d38ad64026b1d00986655ff3c3606f
parent1468f5e1885a52bb3624e6bc551d92cd9429ac72
sysfs: create optimal relative symlink targets

Instead of walking from the source down to the root of sysfs, and back
to the target, we stop at the first directory the source and the target
share.

This link:
  /devices/pci0000:00/0000:00:1d.7/usb1/1-0:1.0/ep_81

pointed to:
  ../../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0/usb_endpoint/usbdev2.1_ep81

now it just points to:
  usb_endpoint/usbdev1.1_ep81

Thanks to Denis Cheng for bringing this up, and sending the initial patch.

CC: Denis Cheng <crquan@gmail.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/symlink.c