1. 22 Jul, 2008 2 commits
    • Kay Sievers's avatar
      kobject: replace '/' with '!' in name · 9f255651
      Kay Sievers authored
      
      Some (block) devices have a '/' in the name, and need special
      handling. Let's have that rule to the core, so we can remove it
      from the block class.
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9f255651
    • Dan Williams's avatar
      sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor · e105b8bf
      Dan Williams authored
      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 ...
      e105b8bf
  2. 21 Jul, 2008 38 commits