04 Jan, 2012

3 commits


02 Nov, 2011

2 commits

  • Replace remaining direct i_nlink updates with a new set_nlink()
    updater function.

    Signed-off-by: Miklos Szeredi
    Tested-by: Toshiyuki Okajima
    Signed-off-by: Christoph Hellwig

    Miklos Szeredi
     
  • In sysfs_rename we need to remove the optimization of not calling
    sysfs_unlink_sibling and sysfs_link_sibling if the renamed parent
    directory is not changing. This optimization is no longer valid now
    that sysfs dirents are stored in an rbtree sorted by name.

    Move the assignment of s_ns before the call of sysfs_link_sibling. With
    no sysfs_dirent fields changing after the call of sysfs_link_sibling
    this allows sysfs_link_sibling to take any of the directory entries into
    account when it builds the rbtrees, and s_ns looks like a prime canidate
    to be used in the rbtree in the future.

    Signed-off-by: Eric W. Biederman
    Cc: Jiri Slaby
    Cc: Greg KH
    Cc: David Miller
    Cc: Mikulas Patocka
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

25 Oct, 2011

2 commits

  • In commit 8a9ea3237e7e ("Merge git://.../davem/net-next") where my sysfs
    changes from the net tree merged with the sysfs rbtree changes from
    Mickulas Patocka the conflict resolution failed to preserve the
    simplified property that was the point of my changes.

    That is sysfs_find_dirent can now say something is a match if and only
    s_name and s_ns match what we are looking for, and sysfs_readdir can
    simply return all of the directory entries where s_ns matches the
    directory that we should be returning.

    Now that we are back to exact matches we can tweak sysfs_find_dirent and
    the name rb_tree to order sysfs_dirents by s_ns s_name and remove the
    second loop in sysfs_find_dirent. However that change seems a bit much
    for a conflict resolution so it can come later.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1745 commits)
    dp83640: free packet queues on remove
    dp83640: use proper function to free transmit time stamping packets
    ipv6: Do not use routes from locally generated RAs
    |PATCH net-next] tg3: add tx_dropped counter
    be2net: don't create multiple RX/TX rings in multi channel mode
    be2net: don't create multiple TXQs in BE2
    be2net: refactor VF setup/teardown code into be_vf_setup/clear()
    be2net: add vlan/rx-mode/flow-control config to be_setup()
    net_sched: cls_flow: use skb_header_pointer()
    ipv4: avoid useless call of the function check_peer_pmtu
    TCP: remove TCP_DEBUG
    net: Fix driver name for mdio-gpio.c
    ipv4: tcp: fix TOS value in ACK messages sent from TIME_WAIT
    rtnetlink: Add missing manual netlink notification in dev_change_net_namespaces
    ipv4: fix ipsec forward performance regression
    jme: fix irq storm after suspend/resume
    route: fix ICMP redirect validation
    net: hold sock reference while processing tx timestamps
    tcp: md5: add more const attributes
    Add ethtool -g support to virtio_net
    ...

    Fix up conflicts in:
    - drivers/net/Kconfig:
    The split-up generated a trivial conflict with removal of a
    stale reference to Documentation/networking/net-modules.txt.
    Remove it from the new location instead.
    - fs/sysfs/dir.c:
    Fairly nasty conflicts with the sysfs rb-tree usage, conflicting
    with Eric Biederman's changes for tagged directories.

    Linus Torvalds
     

20 Oct, 2011

3 commits

  • sysfs is a core piece of ifrastructure that many people use and
    few people have all of the rules in their head on how to use
    it correctly. Add warnings for people using tagged directories
    improperly to that any misuses can be caught and diagnosed quickly.

    A single inexpensive test in sysfs_find_dirent is almost sufficient
    to catch all possible misuses. An additional warning is needed
    in sysfs_add_dirent so that we actually fail when attempting to
    add an untagged dirent in a tagged directory.

    Signed-off-by: Eric W. Biederman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • Now that /sys/class/net/bonding_masters is implemented as a tagged sysfs
    file we can remove support for untagged files in tagged directories.

    This change removes any ambiguity of what a NULL namespace value
    means. A NULL namespace parameter after this patch means
    that we are talking about an untagged sysfs dirent.

    This makes the sysfs code much less prone to mistakes when during
    maintenance.

    Signed-off-by: Eric W. Biederman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • Looking up files in sysfs is hard to understand and analyize because we
    currently allow placing untagged files in tagged directories. In the
    implementation of that we have two subtly different meanings of NULL.
    NULL meaning there is no tag on a directory entry and NULL meaning
    we don't care which namespace the lookup is performed for. This
    multiple uses of NULL have resulted in subtle bugs (since fixed)
    in the code.

    Currently it is only the bonding driver that needs to have an untagged
    file in a tagged directory.

    To untagle this mess I am adding support for tagged files to sysfs.
    Modifying the bonding driver to implement bonding_masters as a tagged
    file. Registering bonding_masters once for each network namespace.
    Then I am removing support for untagged entries in tagged sysfs
    directories.

    Resulting in code that is much easier to reason about.

    Signed-off-by: Eric W. Biederman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

27 Sep, 2011

1 commit

  • "sysfs: use rb-tree for inode number lookup" added a new printk which
    causes a new compile warning on s390 (and few other architectures):

    fs/sysfs/dir.c: In function 'sysfs_link_sibling':
    fs/sysfs/dir.c:63:4: warning: format '%lx' expects argument of type
    'long unsigned int', but argument 2 has type 'ino_t' [-Wform

    Add an explicit unsigned long cast since ino_t is an unsigned long on
    most architectures.

    Cc: Mikulas Patocka
    Signed-off-by: Heiko Carstens
    Signed-off-by: Greg Kroah-Hartman

    Heiko Carstens
     

23 Aug, 2011

4 commits

  • sysfs: use rb-tree for inode number lookup

    This patch makes sysfs use red-black tree for inode number lookup.
    Together with a previous patch to use red-black tree for name lookup,
    this patch makes all sysfs lookups to have O(log n) complexity.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • sysfs: remove s_sibling hacks

    s_sibling was used for three different purposes:
    1) as a linked list of entries in the directory
    2) as a linked list of entries to be deleted
    3) as a pointer to "struct completion"

    This patch removes the hack and introduces new union u which
    holds pointers for cases 2) and 3).

    This change is needed for the following patch that removes s_sibling at all
    and replaces it with a rb tree.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • sysfs: use rb-tree for name lookups

    Use red-black tree for name lookups.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • sysfs: count subdirectories

    This patch introduces a subdirectory counter for each sysfs directory.

    Without the patch, sysfs_refresh_inode would walk all entries of the directory
    to calculate the number of subdirectories.

    This patch improves time of "ls -la /sys/block" when there are 10000 block
    devices from 9 seconds to 0.19 seconds.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     

20 Jul, 2011

3 commits


13 Jun, 2011

1 commit

  • * new refcount in struct net, controlling actual freeing of the memory
    * new method in kobj_ns_type_operations (->drop_ns())
    * ->current_ns() semantics change - it's supposed to be followed by
    corresponding ->drop_ns(). For struct net in case of CONFIG_NET_NS it bumps
    the new refcount; net_drop_ns() decrements it and calls net_free() if the
    last reference has been dropped. Method renamed to ->grab_current_ns().
    * old net_free() callers call net_drop_ns() instead.
    * sysfs_exit_ns() is gone, along with a large part of callchain
    leading to it; now that the references stored in ->ns[...] stay valid we
    do not need to hunt them down and replace them with NULL. That fixes
    problems in sysfs_lookup() and sysfs_readdir(), along with getting rid
    of sb->s_instances abuse.

    Note that struct net *shutdown* logics has not changed - net_cleanup()
    is called exactly when it used to be called. The only thing postponed by
    having a sysfs instance refering to that struct net is actual freeing of
    memory occupied by struct net.

    Signed-off-by: Al Viro

    Al Viro
     

14 May, 2011

1 commit

  • On some arches (x86, sh, arm, unicore, powerpc) the oops message would
    print out the last sysfs file accessed.

    This was very useful in finding a number of sysfs and driver core bugs
    in the 2.5 and early 2.6 development days, but it has been a number of
    years since this file has actually helped in debugging anything that
    couldn't also be trivially determined from the stack traceback.

    So it's time to delete the line. This is good as we need all the space
    we can get for oops messages at times on consoles.

    Acked-by: Phil Carmody
    Acked-by: Ingo Molnar
    Cc: Andrew Morton
    Cc: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 May, 2011

1 commit


21 Jan, 2011

1 commit

  • The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
    is used to configure any non-standard kernel with a much larger scope than
    only small devices.

    This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
    references to the option throughout the kernel. A new CONFIG_EMBEDDED
    option is added that automatically selects CONFIG_EXPERT when enabled and
    can be used in the future to isolate options that should only be
    considered for embedded systems (RISC architectures, SLOB, etc).

    Calling the option "EXPERT" more accurately represents its intention: only
    expert users who understand the impact of the configuration changes they
    are making should enable it.

    Reviewed-by: Ingo Molnar
    Acked-by: David Woodhouse
    Signed-off-by: David Rientjes
    Cc: Greg KH
    Cc: "David S. Miller"
    Cc: Jens Axboe
    Cc: Arnd Bergmann
    Cc: Robin Holt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

11 Jan, 2011

2 commits


07 Jan, 2011

4 commits

  • Signed-off-by: Nick Piggin

    Nick Piggin
     
  • Require filesystems be aware of .d_revalidate being called in rcu-walk
    mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
    -ECHILD from all implementations.

    Signed-off-by: Nick Piggin

    Nick Piggin
     
  • Reduce some branches and memory accesses in dcache lookup by adding dentry
    flags to indicate common d_ops are set, rather than having to check them.
    This saves a pointer memory access (dentry->d_op) in common path lookup
    situations, and saves another pointer load and branch in cases where we
    have d_op but not the particular operation.

    Patched with:

    git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i

    Signed-off-by: Nick Piggin

    Nick Piggin
     
  • Change d_delete from a dentry deletion notification to a dentry caching
    advise, more like ->drop_inode. Require it to be constant and idempotent,
    and not take d_lock. This is how all existing filesystems use the callback
    anyway.

    This makes fine grained dentry locking of dput and dentry lru scanning
    much simpler.

    Signed-off-by: Nick Piggin

    Nick Piggin
     

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
     

29 Oct, 2010

1 commit


23 Oct, 2010

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • bb->vm_ops is a cached copy of the vm_ops of the underlying
    sysfs bin file, which means that after sysfs_bin_remove_file
    completes it is only longer valid to deference bb->vm_ops.

    So move all of the tests of bb->vm_ops inside of where
    we hold the sysfs active lock.

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

    Eric W. Biederman
     
  • It is not reasonably possible to wrap vma->close(). To correctly
    wrap close would imply calling close on any vmas that remain when
    sysfs_remove_bin_file is called. Finding the proper lists walking
    them getting the locking right etc, requires deep knowledge of the
    mm subsystem and as such would require assistence from the mm
    subsystem to implement. That assistence does not currently exist.

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

    Eric W. Biederman
     

17 Oct, 2010

1 commit


04 Sep, 2010

1 commit


11 Aug, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

2 commits


06 Aug, 2010

1 commit


27 Jul, 2010

1 commit