1. 24 Jan, 2008 4 commits
  2. 17 Dec, 2007 1 commit
  3. 28 Nov, 2007 1 commit
  4. 30 Oct, 2007 1 commit
  5. 12 Oct, 2007 7 commits
  6. 11 Jul, 2007 2 commits
    • Tejun Heo's avatar
      sysfs: make kobj point to sysfs_dirent instead of dentry · 608e266a
      Tejun Heo authored
      
      
      As kobj sysfs dentries and inodes are gonna be made reclaimable,
      dentry can't be used as naming token for sysfs file/directory, replace
      kobj->dentry with kobj->sd.  The only external interface change is
      shadow directory handling.  All other changes are contained in kobj
      and sysfs.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      608e266a
    • Kay Sievers's avatar
      Driver core: add missing kset uevent · 80f03e34
      Kay Sievers authored
      
      
      We get uevents for a bus/class going away, but not one registering.
      Add the missing uevent in kset_register(), which will send an
      event for a new bus/class. Suppress all unwanted uevents for bus
      subdirectories like /bus/*/devices/, /bus/*/drivers/.
      
      Now we get for module usbcore:
        add      /module/usbcore (module)
        add      /bus/usb (bus)
        add      /class/usb_host (class)
        add      /bus/usb/drivers/hub (drivers)
        add      /bus/usb/drivers/usb (drivers)
        remove   /bus/usb/drivers/usb (drivers)
        remove   /bus/usb/drivers/hub (drivers)
        remove   /class/usb_host (class)
        remove   /bus/usb (bus)
        remove   /module/usbcore (module)
      
      instead of:
        add      /module/usbcore (module)
        add      /bus/usb/drivers/hub (drivers)
        add      /bus/usb/drivers/usb (drivers)
        remove   /bus/usb/drivers/usb (drivers)
        remove   /bus/usb/drivers/hub (drivers)
        remove   /class/usb_host (class)
        remove   /bus/usb/drivers (bus)
        remove   /bus/usb/devices (bus)
        remove   /bus/usb (bus)
        remove   /module/usbcore (module)
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      80f03e34
  7. 08 Jun, 2007 1 commit
  8. 02 May, 2007 1 commit
  9. 27 Apr, 2007 6 commits
  10. 09 Mar, 2007 1 commit
  11. 16 Feb, 2007 2 commits
    • Randy Dunlap's avatar
      PCI/sysfs/kobject kernel-doc fixes · f95d882d
      Randy Dunlap authored
      
      
      Fix kernel-doc warnings in PCI, sysfs, and kobject files.
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f95d882d
    • Martin Stoilov's avatar
      kobject: kobj->k_name verification fix · 13507701
      Martin Stoilov authored
      
      
      The function 'kobject_add' tries to verify the name of
      a new kobject instance is properly set before continuing.
          if (!kobj->k_name)
              kobj->k_name = kobj->name;
          if (!kobj->k_name) {
              pr_debug("kobject attempted to be registered with no name!\n");
              WARN_ON(1);
              return -EINVAL;
          }
      The statement:
          if (!kobj->k_name) {
              pr_debug("kobject attempted to be registered with no name!\n");
              WARN_ON(1);
              return -EINVAL;
          }
      is useless the way it is right now, because it can never be true. I
      think the
      code was intended to be:
          if (!kobj->k_name)
              kobj->k_name = kobj->name;
          if (!*kobj->k_name) {
              pr_debug("kobject attempted to be registered with no name!\n");
              WARN_ON(1);
              return -EINVAL;
          }
      because this would make sure the kobj->name buffer has something in it.
      So the missing '*' is just a typo. Although, I would much prefer
      expression like:
          if (*kobj->k_name == '\0') {
              pr_debug("kobject attempted to be registered with no name!\n");
              WARN_ON(1);
              return -EINVAL;
          }
      
      because this would've made the intention clear, in this patch I just restore
      the missing '*' without changing the coding style of the function.
      Signed-off-by: default avatarMartin Stoilov <mstoilov@odesys.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      13507701
  12. 11 Feb, 2007 1 commit
  13. 07 Feb, 2007 4 commits
    • Eric W. Biederman's avatar
      sysfs: Shadow directory support · b592fcfe
      Eric W. Biederman authored
      
      
      The problem.  When implementing a network namespace I need to be able
      to have multiple network devices with the same name.  Currently this
      is a problem for /sys/class/net/*. 
      
      What I want is a separate /sys/class/net directory in sysfs for each
      network namespace, and I want to name each of them /sys/class/net.
      
      I looked and the VFS actually allows that.  All that is needed is
      for /sys/class/net to implement a follow link method to redirect
      lookups to the real directory you want. 
      
      Implementing a follow link method that is sensitive to the current
      network namespace turns out to be 3 lines of code so it looks like a
      clean approach.  Modifying sysfs so it doesn't get in my was is a bit
      trickier. 
      
      I am calling the concept of multiple directories all at the same path
      in the filesystem shadow directories.  With the directory entry really
      at that location the shadow master. 
      
      The following patch modifies sysfs so it can handle a directory
      structure slightly different from the kobject tree so I can implement
      the shadow directories for handling /sys/class/net/.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Cc: Maneesh Soni <maneesh@in.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b592fcfe
    • Mariusz Kozlowski's avatar
      kobject: kobject_put cleanup · b067db49
      Mariusz Kozlowski authored
      
      
      This patch removes redundant argument checks for kobject_put().
      Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b067db49
    • Cornelia Huck's avatar
      driver core: Allow device_move(dev, NULL). · c744aeae
      Cornelia Huck authored
      
      
      If we allow NULL as the new parent in device_move(), we need to make sure
      that the device is placed into the same place as it would if it was
      newly registered:
      
      - Consider the device virtual tree. In order to be able to reuse code,
        setup_parent() has been tweaked a bit.
      - kobject_move() can fall back to the kset's kobject.
      - sysfs_move_dir() uses the sysfs root dir as fallback.
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c744aeae
    • Greg Kroah-Hartman's avatar
      Kobject: make kobject apis more robust in handling NULL pointers · 31b9025a
      Greg Kroah-Hartman authored
      
      
      It should be ok to pass in NULL for some kobject functions, so add error
      checking for all exported kobject functions to be more robust.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      31b9025a
  14. 07 Dec, 2006 1 commit
  15. 01 Dec, 2006 1 commit
  16. 10 Oct, 2006 1 commit
  17. 25 Sep, 2006 1 commit
  18. 21 Jun, 2006 1 commit
  19. 21 May, 2006 1 commit
  20. 27 Apr, 2006 1 commit
  21. 14 Apr, 2006 1 commit
    • NeilBrown's avatar
      [PATCH] sysfs: Allow sysfs attribute files to be pollable · 4508a7a7
      NeilBrown authored
      
      
      It works like this:
        Open the file
        Read all the contents.
        Call poll requesting POLLERR or POLLPRI (so select/exceptfds works)
        When poll returns,
           close the file and go to top of loop.
         or lseek to start of file and go back to the 'read'.
      
      Events are signaled by an object manager calling
         sysfs_notify(kobj, dir, attr);
      
      If the dir is non-NULL, it is used to find a subdirectory which
      contains the attribute (presumably created by sysfs_create_group).
      
      This has a cost of one int  per attribute, one wait_queuehead per kobject,
      one int per open file.
      
      The name "sysfs_notify" may be confused with the inotify
      functionality.  Maybe it would be nice to support inotify for sysfs
      attributes as well?
      
      This patch also uses sysfs_notify to allow /sys/block/md*/md/sync_action
      to be pollable
      Signed-off-by: default avatarNeil Brown <neilb@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4508a7a7