23 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     

21 Jul, 2011

1 commit

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

20 Jul, 2011

1 commit


22 Jun, 2011

1 commit

  • Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).

    To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
    definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
    via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
    Removal of mm.h from scatterlist.h was tried and was found not feasible
    on most archs, so the link was cutoff earlier.

    Hope people are OK with tiny include file.

    Note, that mm_types.h is still dragged in, but it is a separate story.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

21 May, 2011

1 commit

  • Commit e66eed651fd1 ("list: remove prefetching from regular list
    iterators") removed the include of prefetch.h from list.h, which
    uncovered several cases that had apparently relied on that rather
    obscure header file dependency.

    So this fixes things up a bit, using

    grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
    grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')

    to guide us in finding files that either need
    inclusion, or have it despite not needing it.

    There are more of them around (mostly network drivers), but this gets
    many core ones.

    Reported-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

31 Mar, 2011

1 commit


17 Mar, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1480 commits)
    bonding: enable netpoll without checking link status
    xfrm: Refcount destination entry on xfrm_lookup
    net: introduce rx_handler results and logic around that
    bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
    bonding: wrap slave state work
    net: get rid of multiple bond-related netdevice->priv_flags
    bonding: register slave pointer for rx_handler
    be2net: Bump up the version number
    be2net: Copyright notice change. Update to Emulex instead of ServerEngines
    e1000e: fix kconfig for crc32 dependency
    netfilter ebtables: fix xt_AUDIT to work with ebtables
    xen network backend driver
    bonding: Improve syslog message at device creation time
    bonding: Call netif_carrier_off after register_netdevice
    bonding: Incorrect TX queue offset
    net_sched: fix ip_tos2prio
    xfrm: fix __xfrm_route_forward()
    be2net: Fix UDP packet detected status in RX compl
    Phonet: fix aligned-mode pipe socket buffer header reserve
    netxen: support for GbE port settings
    ...

    Fix up conflicts in drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
    with the staging updates.

    Linus Torvalds
     

15 Mar, 2011

1 commit


04 Mar, 2011

1 commit

  • Netlink message processing in the kernel is synchronous these days,
    capabilities can be checked directly in security_netlink_recv() from
    the current process.

    Signed-off-by: Patrick McHardy
    Reviewed-by: James Morris
    [chrisw: update to include pohmelfs and uvesafb]
    Signed-off-by: Chris Wright
    Signed-off-by: David S. Miller

    Patrick McHardy
     

05 Feb, 2011

1 commit


22 Jan, 2011

1 commit


13 Jan, 2011

1 commit


11 Jan, 2011

1 commit

  • * 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (510 commits)
    staging: speakup: fix failure handling
    staging: usbip: remove double giveback of URB
    Staging: batman-adv: Remove batman-adv from staging
    Staging: hv: Use only one txf buffer per channel and kmalloc/GFP_KERNEL on initialize
    staging: hv: remove unneeded osd_schedule_callback
    staging: hv: convert channel_mgmt.c to not call osd_schedule_callback
    staging: hv: convert vmbus_on_msg_dpc to not call osd_schedule_callback
    staging: brcm80211: Fix WL_ logging macros
    Staging: IIO: DDS: AD9833 / AD9834 driver
    Staging: IIO: dds.h convenience macros
    Staging: IIO: Direct digital synthesis abi documentation
    staging: brcm80211: Convert ETHER_TYPE_802_1X to ETH_P_PAE
    staging: brcm80211: Remove unused ETHER_TYPE_ #defines
    staging: brcm80211: Remove ETHER_HDR_LEN, use ETH_HLEN
    staging: brcm80211: Convert ETHER_ADDR_LEN to ETH_ALEN
    staging: brcm80211: Convert ETHER_IS to is__ether_addr
    staging: brcm80211: Remove unused ether_ #defines and struct
    staging: brcm80211: Convert ETHER_IS_MULTI to is_multicast_ether_addr
    staging: brcm80211: Remove unused #defines ETHER__LOCALADDR
    Staging: comedi: Fix checkpatch.pl issues in file s526.c
    ...

    Fix up trivial conflict in drivers/video/udlfb.c

    Linus Torvalds
     

08 Jan, 2011

1 commit

  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits)
    usb: don't use flush_scheduled_work()
    speedtch: don't abuse struct delayed_work
    media/video: don't use flush_scheduled_work()
    media/video: explicitly flush request_module work
    ioc4: use static work_struct for ioc4_load_modules()
    init: don't call flush_scheduled_work() from do_initcalls()
    s390: don't use flush_scheduled_work()
    rtc: don't use flush_scheduled_work()
    mmc: update workqueue usages
    mfd: update workqueue usages
    dvb: don't use flush_scheduled_work()
    leds-wm8350: don't use flush_scheduled_work()
    mISDN: don't use flush_scheduled_work()
    macintosh/ams: don't use flush_scheduled_work()
    vmwgfx: don't use flush_scheduled_work()
    tpm: don't use flush_scheduled_work()
    sonypi: don't use flush_scheduled_work()
    hvsi: don't use flush_scheduled_work()
    xen: don't use flush_scheduled_work()
    gdrom: don't use flush_scheduled_work()
    ...

    Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c
    as per Tejun.

    Linus Torvalds
     

07 Jan, 2011

3 commits

  • RCU free the struct inode. This will allow:

    - Subsequent store-free path walking patch. The inode must be consulted for
    permissions when walking, so an RCU inode reference is a must.
    - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
    to take i_lock no longer need to take sb_inode_list_lock to walk the list in
    the first place. This will simplify and optimize locking.
    - Could remove some nested trylock loops in dcache code
    - Could potentially simplify things a bit in VM land. Do not need to take the
    page lock to follow page->mapping.

    The downsides of this is the performance cost of using RCU. In a simple
    creat/unlink microbenchmark, performance drops by about 10% due to inability to
    reuse cache-hot slab objects. As iterations increase and RCU freeing starts
    kicking over, this increases to about 20%.

    In cases where inode lifetimes are longer (ie. many inodes may be allocated
    during the average life span of a single inode), a lot of this cache reuse is
    not applicable, so the regression caused by this patch is smaller.

    The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
    however this adds some complexity to list walking and store-free path walking,
    so I prefer to implement this at a later date, if it is shown to be a win in
    real situations. I haven't found a regression in any non-micro benchmark so I
    doubt it will be a problem.

    Signed-off-by: Nick Piggin

    Nick Piggin
     
  • dcache_lock no longer protects anything. remove it.

    Signed-off-by: Nick Piggin

    Nick Piggin
     
  • The remaining usages for dcache_lock is to allow atomic, multi-step read-side
    operations over the directory tree by excluding modifications to the tree.
    Also, to walk in the leaf->root direction in the tree where we don't have
    a natural d_lock ordering.

    This could be accomplished by taking every d_lock, but this would mean a
    huge number of locks and actually gets very tricky.

    Solve this instead by using the rename seqlock for multi-step read-side
    operations, retry in case of a rename so we don't walk up the wrong parent.
    Concurrent dentry insertions are not serialised against. Concurrent deletes
    are tricky when walking up the directory: our parent might have been deleted
    when dropping locks so also need to check and retry for that.

    We can also use the rename lock in cases where livelock is a worry (and it
    is introduced in subsequent patch).

    Signed-off-by: Nick Piggin

    Nick Piggin
     

15 Dec, 2010

1 commit

  • cancel_rearming_delayed_work[queue]() has been superceded by
    cancel_delayed_work_sync() quite some time ago. Convert all the
    in-kernel users. The conversions are completely equivalent and
    trivial.

    Signed-off-by: Tejun Heo
    Acked-by: "David S. Miller"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Evgeniy Polyakov
    Cc: Jeff Garzik
    Cc: Benjamin Herrenschmidt
    Cc: Mauro Carvalho Chehab
    Cc: netdev@vger.kernel.org
    Cc: Anton Vorontsov
    Cc: David Woodhouse
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Alex Elder
    Cc: xfs-masters@oss.sgi.com
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Andrew Morton
    Cc: netfilter-devel@vger.kernel.org
    Cc: Trond Myklebust
    Cc: linux-nfs@vger.kernel.org

    Tejun Heo
     

10 Nov, 2010

1 commit

  • Hi,

    crypto_free_hash() and crypto_free_ablkcipher() are just wrappers around
    crypto_free_tfm() which is itself just a wrapper around
    crypto_destroy_tfm().
    Passing crypto_destroy_tfm() a NULL pointer is valid, so there's no reason
    to check for NULL first.

    Removing the unneeded conditionals (which is what the patch does) brings
    us the benefit of having to execute a few fewer test/branch instructions
    and also reduces object code size slightly:

    before:
    text data bss dec hex filename
    8630 112 3312 12054 2f16 drivers/staging/pohmelfs/crypto.o

    0000000000000cbe :
    cbe: 55 push %rbp
    cbf: 48 89 e5 mov %rsp,%rbp
    cc2: 53 push %rbx
    cc3: 48 83 ec 08 sub $0x8,%rsp
    cc7: e8 00 00 00 00 callq ccc
    ccc: 48 ff 05 00 00 00 00 incq 0x0(%rip) # cd3
    cd3: 48 89 fb mov %rdi,%rbx
    cd6: 48 8b 7f 20 mov 0x20(%rdi),%rdi
    cda: 48 85 ff test %rdi,%rdi
    cdd: 74 0c je ceb
    cdf: 48 ff 05 00 00 00 00 incq 0x0(%rip) # ce6
    ce6: e8 58 fa ff ff callq 743
    ceb: 48 8b 7b 28 mov 0x28(%rbx),%rdi
    cef: 48 85 ff test %rdi,%rdi
    cf2: 75 09 jne cfd
    cf4: 48 ff 05 00 00 00 00 incq 0x0(%rip) # cfb
    cfb: eb 16 jmp d13
    cfd: 48 89 fe mov %rdi,%rsi
    d00: 48 ff 05 00 00 00 00 incq 0x0(%rip) # d07
    d07: e8 00 00 00 00 callq d0c
    d0c: 48 ff 05 00 00 00 00 incq 0x0(%rip) # d13
    d13: 48 8b 7b 18 mov 0x18(%rbx),%rdi
    d17: e8 00 00 00 00 callq d1c
    d1c: 48 ff 05 00 00 00 00 incq 0x0(%rip) # d23
    d23: 5e pop %rsi
    d24: 5b pop %rbx
    d25: c9 leaveq
    d26: c3 retq

    after:
    text data bss dec hex filename
    8604 112 3296 12012 2eec drivers/staging/pohmelfs/crypto.o

    0000000000000cbe :
    cbe: 55 push %rbp
    cbf: 48 89 e5 mov %rsp,%rbp
    cc2: 53 push %rbx
    cc3: 48 83 ec 08 sub $0x8,%rsp
    cc7: e8 00 00 00 00 callq ccc
    ccc: 48 ff 05 00 00 00 00 incq 0x0(%rip) # cd3
    cd3: 48 89 fb mov %rdi,%rbx
    cd6: 48 8b 7f 20 mov 0x20(%rdi),%rdi
    cda: e8 64 fa ff ff callq 743
    cdf: 48 8b 7b 28 mov 0x28(%rbx),%rdi
    ce3: 48 ff 05 00 00 00 00 incq 0x0(%rip) # cea
    cea: 48 89 fe mov %rdi,%rsi
    ced: e8 00 00 00 00 callq cf2
    cf2: 48 8b 7b 18 mov 0x18(%rbx),%rdi
    cf6: 48 ff 05 00 00 00 00 incq 0x0(%rip) # cfd
    cfd: e8 00 00 00 00 callq d02
    d02: 48 ff 05 00 00 00 00 incq 0x0(%rip) # d09
    d09: 5e pop %rsi
    d0a: 5b pop %rbx
    d0b: c9 leaveq
    d0c: c3 retq

    Signed-off-by: Jesper Juhl
    Acked-by: Evgeniy Polyakov
    Signed-off-by: Greg Kroah-Hartman

    Jesper Juhl
     

29 Oct, 2010

2 commits


26 Oct, 2010

1 commit

  • Add a new helper to write out the inode using the writeback code,
    that is including the correct dirty bit and list manipulation. A few
    of filesystems already opencode this, and a lot of others should be
    using it instead of using write_inode_now which also writes out the
    data.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

01 Sep, 2010

1 commit

  • list_for_each_entry binds its first argument to a non-null value, and thus
    any null test on the value of that argument is superfluous.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    iterator I;
    expression x;
    statement S;
    @@

    I(x,...) { }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

18 Aug, 2010

1 commit

  • fs: fs_struct rwlock to spinlock

    struct fs_struct.lock is an rwlock with the read-side used to protect root and
    pwd members while taking references to them. Taking a reference to a path
    typically requires just 2 atomic ops, so the critical section is very small.
    Parallel read-side operations would have cacheline contention on the lock, the
    dentry, and the vfsmount cachelines, so the rwlock is unlikely to ever give a
    real parallelism increase.

    Replace it with a spinlock to avoid one or two atomic operations in typical
    path lookup fastpath.

    Signed-off-by: Nick Piggin
    Signed-off-by: Al Viro

    Nick Piggin
     

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

  • ... and let iput_final() do the actual eviction or retention

    Signed-off-by: Al Viro

    Al Viro
     
  • Replace inode_setattr with opencoded variants of it in all callers. This
    moves the remaining call to vmtruncate into the filesystem methods where it
    can be replaced with the proper truncate sequence.

    In a few cases it was obvious that we would never end up calling vmtruncate
    so it was left out in the opencoded variant:

    spufs: explicitly checks for ATTR_SIZE earlier
    btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
    ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above

    In addition to that ncpfs called inode_setattr with handcrafted iattrs,
    which allowed to trim down the opencoded variant.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

23 Jul, 2010

1 commit


23 Jun, 2010

1 commit


19 Jun, 2010

1 commit


31 May, 2010

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
    quota: Convert quota statistics to generic percpu_counter
    ext3 uses rb_node = NULL; to zero rb_root.
    quota: Fixup dquot_transfer
    reiserfs: Fix resuming of quotas on remount read-write
    pohmelfs: Remove dead quota code
    ufs: Remove dead quota code
    udf: Remove dead quota code
    quota: rename default quotactl methods to dquot_
    quota: explicitly set ->dq_op and ->s_qcop
    quota: drop remount argument to ->quota_on and ->quota_off
    quota: move unmount handling into the filesystem
    quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
    quota: move remount handling into the filesystem
    ocfs2: Fix use after free on remount read-only

    Fix up conflicts in fs/ext4/super.c and fs/ufs/file.c

    Linus Torvalds
     

28 May, 2010

1 commit


27 May, 2010

1 commit


18 May, 2010

1 commit

  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

15 May, 2010

1 commit

  • Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,y,flags;
    statement S;
    type T;
    @@

    x =
    - kmalloc
    + kcalloc
    (
    - y * sizeof(T),
    + y, sizeof(T),
    flags);
    if (x == NULL) S
    -memset(x, 0, y * sizeof(T));

    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall

    Julia Lawall
     

12 May, 2010

5 commits