1. 12 7月, 2007 8 次提交
    • T
      sysfs: make sysfs_dirent->s_element a union · 3e519038
      Tejun Heo 提交于
      Make sd->s_element a union of sysfs_elem_{dir|symlink|attr|bin_attr}
      and rename it to s_elem.  This is to achieve...
      
      * some level of type checking : changing symlink to point to
        sysfs_dirent instead of kobject is much safer and less painful now.
      * easier / standardized dereferencing
      * allow sysfs_elem_* to contain more than one entry
      
      Where possible, pointer is obtained by directly deferencing from sd
      instead of going through other entities.  This reduces dependencies to
      dentry, inode and kobject.  to_attr() and to_bin_attr() are unused now
      and removed.
      
      This is in preparation of object reference simplification.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3e519038
    • T
      sysfs: add sysfs_dirent->s_name · 0c096b50
      Tejun Heo 提交于
      Add s_name to sysfs_dirent.  This is to further reduce dependency to
      the associated dentry.  Name is copied for directories and symlinks
      but not for attributes.
      
      Where possible, name dereferences are converted to use sd->s_name.
      sysfs_symlink->link_name and sysfs_get_name() are unused now and
      removed.
      
      This change allows symlink to be implemented using sysfs_dirent tree
      proper, which is the last remaining dentry-dependent sysfs walk.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c096b50
    • T
      sysfs: add sysfs_dirent->s_parent · 13b3086d
      Tejun Heo 提交于
      Add sysfs_dirent->s_parent.  With this patch, each sd points to and
      holds a reference to its parent.  This allows walking sysfs tree
      without referencing sd->s_dentry which can go away anytime if the user
      doesn't control when it's deleted.
      
      sd->s_parent is initialized and parent is referenced in
      sysfs_attach_dirent().  Reference to parent is released when the sd is
      released, so as long as reference to a sd is held, s_parent can be
      followed.
      
      dentry walk in sysfs_readdir() is convereted to s_parent walk.
      
      This will be used to reimplement symlink such that it uses only
      sysfs_dirent tree.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      13b3086d
    • T
      sysfs: consolidate sysfs_dirent creation functions · a26cd722
      Tejun Heo 提交于
      Currently there are four functions to create sysfs_dirent -
      __sysfs_new_dirent(), sysfs_new_dirent(), __sysfs_make_dirent() and
      sysfs_make_dirent().  Other than sysfs_make_dirent(), no function has
      two users if calls to implement other functions are excluded.
      
      This patch consolidates sysfs_dirent creation functions into the
      following two.
      
      * sysfs_new_dirent() : allocate and initialize
      * sysfs_attach_dirent() : attach to sysfs_dirent hierarchy and/or
      			  associate with dentry
      
      This simplifies interface and gives callers more flexibility.  This is
      in preparation of object reference simplification.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a26cd722
    • T
      sysfs: flatten and fix sysfs_rename_dir() error handling · 996b7376
      Tejun Heo 提交于
      Error handling in sysfs_rename_dir() was broken.
      
      * When lookup_one_len() fails, 0 is returned.
      
      * If parent inode check fails, returns with inode mutex and rename
        rwsem held.
      
      This patch fixes the above bugs and flattens error handling such that
      it's more readable and easier to modify.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      996b7376
    • T
      sysfs: flatten cleanup paths in sysfs_add_link() and create_dir() · dfeb9fb0
      Tejun Heo 提交于
      Flatten cleanup paths in sysfs_add_link() and create_dir() to improve
      readability and ease further changes to these functions.  This is in
      preparation of object reference simplification.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dfeb9fb0
    • T
      sysfs: allocate inode number using ida · 2b611bb7
      Tejun Heo 提交于
      sysfs used simple incrementing allocator which is not guaranteed to be
      unique.  This patch makes sysfs use ida to give each sd a unique and
      packed inode number.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2b611bb7
    • T
      sysfs: move release_sysfs_dirent() to dir.c · fa7f912a
      Tejun Heo 提交于
      There is no reason this function should be inlined and soon to follow
      sysfs object reference simplification will make it heavier.  Move it
      to dir.c.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fa7f912a
  2. 13 6月, 2007 2 次提交
  3. 07 3月, 2007 1 次提交
    • M
      [PATCH] Fix 2.6.21 rfcomm lockups · 0de1517e
      Mark Lord 提交于
      Any attempt to open/use a bluetooth rfcomm device locks up
      scheduling completely on my machine.
      
      Interrupts (ping, alt-sysrq) seem to be alive, but nothing else.
      
      This was working fine in 2.6.20, broken now in 2.6.21-rc2-git*
      
      Reverting this change (below) fixes it:
      
      | author    Marcel Holtmann <marcel@holtmann.org>
      |      Sat, 17 Feb 2007 22:58:57 +0000 (23:58 +0100)
      | committer    David S. Miller <davem@sunset.davemloft.net>
      |      Mon, 26 Feb 2007 19:42:41 +0000 (11:42 -0800)
      | commit    c1a33136
      | tree    337a876f727061362b6a169f8759849c105b8f7a    tree | snapshot
      | parent    f5ffd462    commit | diff
      | | [Bluetooth] Make use of device_move() for RFCOMM TTY devices
      | | In the case of bound RFCOMM TTY devices the parent is not available
      | before its usage. So when opening a RFCOMM TTY device, move it to
      | the corresponding ACL device as a child. When closing the device,
      | move it back to the virtual device tree.
      | Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
      
      The simplest fix for this bug is to prevent sysfs_move_dir()
      from self-deadlocking when (old_parent == new_parent).
      
      This patch prevents total system lockup when using rfcomm devices.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0de1517e
  4. 13 2月, 2007 1 次提交
  5. 12 2月, 2007 1 次提交
  6. 08 2月, 2007 3 次提交
    • E
      sysfs: Shadow directory support · b592fcfe
      Eric W. Biederman 提交于
      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: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Maneesh Soni <maneesh@in.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b592fcfe
    • O
      Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() · 94bebf4d
      Oliver Neukum 提交于
      This patch prevents a race between IO and removing a file from sysfs.
      It introduces a list of sysfs_buffers associated with a file at the inode.
      Upon removal of a file the list is walked and the buffers marked orphaned.
      IO to orphaned buffers fails with -ENODEV. The driver can safely free
      associated data structures or be unloaded.
      Signed-off-by: NOliver Neukum <oliver@neukum.name>
      Acked-by: NManeesh Soni <maneesh@in.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      94bebf4d
    • C
      driver core: Allow device_move(dev, NULL). · c744aeae
      Cornelia Huck 提交于
      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: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c744aeae
  7. 09 12月, 2006 1 次提交
  8. 02 12月, 2006 1 次提交
  9. 01 10月, 2006 1 次提交
  10. 26 9月, 2006 1 次提交
  11. 27 6月, 2006 1 次提交
  12. 15 4月, 2006 1 次提交
    • N
      [PATCH] sysfs: Allow sysfs attribute files to be pollable · 4508a7a7
      NeilBrown 提交于
      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: NNeil Brown <neilb@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4508a7a7
  13. 02 4月, 2006 1 次提交
  14. 29 3月, 2006 1 次提交
  15. 21 3月, 2006 3 次提交
  16. 10 1月, 2006 1 次提交
  17. 05 1月, 2006 1 次提交
  18. 24 6月, 2005 1 次提交
  19. 21 6月, 2005 2 次提交
  20. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4