04 Jan, 2012

1 commit


11 May, 2011

1 commit


30 Nov, 2010

1 commit

  • Dan Carpenter pointed out that the new sysfs_merge_group() and
    sysfs_unmerge_group() routines requires their grp argument to be
    non-NULL, because they dereference grp to obtain the list of
    attributes. Hence it's pointless for the routines to include a test
    and special-case handling for when grp is NULL. This patch (as1433)
    removes the unneeded tests.

    Signed-off-by: Alan Stern
    CC: Dan Carpenter
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

17 Oct, 2010

1 commit


22 May, 2010

1 commit

  • 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/*, /sys/devices/virtual/net/*, and
    potentially a few other directories of the form /sys/ ... /net/*.

    What this patch does is to add an additional tag field to the
    sysfs dirent structure. For directories that should show different
    contents depending on the context such as /sys/class/net/, and
    /sys/devices/virtual/net/ this tag field is used to specify the
    context in which those directories should be visible. Effectively
    this is the same as creating multiple distinct directories with
    the same name but internally to sysfs the result is nicer.

    I am calling the concept of a single directory that looks like multiple
    directories all at the same path in the filesystem tagged directories.

    For the networking namespace the set of directories whose contents I need
    to filter with tags can depend on the presence or absence of hotplug
    hardware or which modules are currently loaded. Which means I need
    a simple race free way to setup those directories as tagged.

    To achieve a reace free design all tagged directories are created
    and managed by sysfs itself.

    Users of this interface:
    - define a type in the sysfs_tag_type enumeration.
    - call sysfs_register_ns_types with the type and it's operations
    - sysfs_exit_ns when an individual tag is no longer valid

    - Implement mount_ns() which returns the ns of the calling process
    so we can attach it to a sysfs superblock.
    - Implement ktype.namespace() which returns the ns of a syfs kobject.

    Everything else is left up to sysfs and the driver layer.

    For the network namespace mount_ns and namespace() are essentially
    one line functions, and look to remain that.

    Tags are currently represented a const void * pointers as that is
    both generic, prevides enough information for equality comparisons,
    and is trivial to create for current users, as it is just the
    existing namespace pointer.

    The work needed in sysfs is more extensive. At each directory
    or symlink creating I need to check if the directory it is being
    created in is a tagged directory and if so generate the appropriate
    tag to place on the sysfs_dirent. Likewise at each symlink or
    directory removal I need to check if the sysfs directory it is
    being removed from is a tagged directory and if so figure out
    which tag goes along with the name I am deleting.

    Currently only directories which hold kobjects, and
    symlinks are supported. There is not enough information
    in the current file attribute interfaces to give us anything
    to discriminate on which makes it useless, and there are
    no potential users which makes it an uninteresting problem
    to solve.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Benjamin Thery
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     

27 Jul, 2008

1 commit

  • Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes
    part of the warning section for better reporting/collection. Also, with this,
    one fo the if() sections collapses entirely into the WARN().

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

23 Apr, 2008

1 commit

  • We have a problem in scsi_transport_spi in that we need to customise
    not only the visibility of the attributes, but also their mode. Fix
    this by making the is_visible() callback return a mode, with 0
    indicating is not visible.

    Also add a sysfs_update_group() API to allow us to change either the
    visibility or mode of the files at any time on the fly.

    Acked-by: Kay Sievers
    Signed-off-by: James Bottomley

    James Bottomley
     

08 Feb, 2008

1 commit

  • It's possible that the caller of sysfs_remove_group messed up and passed in an attribute group that was not really registered to this kobject. But don't panic for such a foolish error, spit out a warning about what happened, and continue on our way safely.

    Cc: Roland Dreier
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

24 Jan, 2008

1 commit

  • This patch allows the various users of attribute_groups to selectively
    allow the appearance of group attributes. The primary consumer of
    this will be the transport classes in which we currently have
    elaborate attribute selection algorithms to do this same thing.

    Acked-by: Greg KH
    Signed-off-by: James Bottomley

    James Bottomley
     

13 Oct, 2007

2 commits

  • While shadow directories appear to be a good idea, the current scheme
    of controlling their creation and destruction outside of sysfs appears
    to be a locking and maintenance nightmare in the face of sysfs
    directories dynamically coming and going. Which can now occur for
    directories containing network devices when CONFIG_SYSFS_DEPRECATED is
    not set.

    This patch removes everything from the initial shadow directory support
    that allowed the shadow directory creation to be controlled at a higher
    level. So except for a few bits of sysfs_rename_dir everything from
    commit b592fcfe7f06c15ec11774b5be7ce0de3aa86e73 is now gone.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • Cleanup semaphore.h

    Signed-off-by: Dave Young
    Signed-off-by: Greg Kroah-Hartman

    Dave Young
     

12 Jul, 2007

1 commit

  • 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: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

28 Apr, 2007

1 commit

  • Prevent permission checking from being performed when the kernel wants to
    unconditionally remove a sysfs group, by introducing an kernel-only variant
    of lookup_one_len(), lookup_one_len_kern().

    Additionally, as sysfs_remove_group() does not check the return value of
    the lookup before using it, a BUG_ON has been added to pinpoint the cause
    of any problems potentially caused by this (and as a form of annotation).

    Signed-off-by: James Morris
    Cc: Nagendra Singh Tomar
    Cc: Tejun Heo
    Cc: Stephen Smalley
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    James Morris
     

08 Feb, 2007

2 commits

  • 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: Eric W. Biederman
    Cc: Maneesh Soni
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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: Oliver Neukum
    Acked-by: Maneesh Soni
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     

24 Jun, 2005

1 commit

  • Various filesystem drivers have grown a get_dentry() function that's a
    duplicate of lookup_one_len, except that it doesn't take a maximum length
    argument and doesn't check for \0 or / in the passed in filename.

    Switch all these places to use lookup_one_len.

    Signed-off-by: Christoph Hellwig
    Cc: Greg KH
    Cc: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds