07 Nov, 2009

13 commits

  • Making the BKL usage explicit in ipx makes it more
    obvious where it is used, reduces code size and helps
    getting rid of the BKL in common code.

    I did not analyse how to kill lock_kernel from ipx
    entirely, this will involve either proving that it's not
    needed, or replacing with a proper mutex or spinlock,
    after finding out which data structures are protected
    by the lock.

    Cc: Arnaldo Carvalho de Melo
    Cc: David S. Miller
    Cc: Stephen Hemminger
    Cc: netdev@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • Making the BKL usage explicit in appletalk makes it more
    obvious where it is used, reduces code size and helps
    getting rid of the BKL in common code.

    I did not analyse how to kill lock_kernel from appletalk
    entirely, this will involve either proving that it's not
    needed, or replacing with a proper mutex or spinlock,
    after finding out which data structures are protected
    by the lock.

    Cc: Arnaldo Carvalho de Melo
    Cc: David S. Miller
    Cc: Stephen Hemminger
    Cc: netdev@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • change atl1c_buffer struct, use "u16 flags" instead of "u16 state"
    to store more infomation for atl1c_buffer, and restructure clean
    atl1c_buffer procedure, add common api atl1c_clean_buffer.

    Signed-off-by: Jie Yang
    Signed-off-by: David S. Miller

    Jie Yang
     
  • SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: David S. Miller

    Thomas Gleixner
     
  • It's defined colloqually in linux/if.h and linux/compat.h
    includes that.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The MII ioctls and SIOCSIFNAME need to go through ifsioc conversion,
    which they never did so far. Some others are not implemented in the
    native path, so we can just return -EINVAL directly.

    Add IFSLAVE ioctls to the EINVAL list and move it to the end to
    optimize the code path for the common case.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • This removes the original socket compat_ioctl code
    from fs/compat_ioctl.c and converts the code from the copy
    in net/socket.c into a single function. We add a few cycles
    of runtime to compat_sock_ioctl() with the long switch()
    statement, but gain some cycles in return by simplifying
    the call chain to get there.

    Due to better inlining, save 1.5kb of object size in the
    process, and enable further savings:

    before:
    text data bss dec hex filename
    13540 18008 2080 33628 835c obj/fs/compat_ioctl.o
    14565 636 40 15241 3b89 obj/net/socket.o

    after:
    text data bss dec hex filename
    8916 15176 2080 26172 663c obj/fs/compat_ioctl.o
    20725 636 40 21401 5399 obj/net/socket.o

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • We must not have a compat ioctl handler for SIOCATALKDIFADDR
    in common code, because the same number is used in other protocols
    with different data structures.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • This makes an identical copy of the socket compat_ioctl code
    from fs/compat_ioctl.c to net/socket.c, as a preparation
    for moving the functionality in a way that can be easily
    reviewed.

    The code is hidden inside of #if 0 and gets activated in the
    patch that will make it work.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • Slip and a few other drivers use the same ioctl numbers on
    tty devices that are normally meant for sockets. This causes
    problems with our compat_ioctl handling that tries to convert
    the data structures in a different format.

    Fortunately, these five drivers all use 32 bit compatible
    data structures in the ioctl numbers, so we can just add
    a trivial compat_ioctl conversion function to each of them.

    SIOCSIFENCAP and SIOCGIFENCAP do not need to live in
    fs/compat_ioctl.c after this any more, and they are not
    used on any sockets.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • The tun driver is the only code in the kernel that operates
    on a character device with struct ifreq. Change the driver
    to handle the conversion itself so we can contain the
    remaining ifreq handling in the socket layer.

    This also fixes a bug in the handling of invalid ioctl
    numbers on an unbound tun device. The driver treats this
    as a TUNSETIFF in native mode, but there is no way for
    the generic compat_ioctl() function to emulate this
    behaviour. Possibly the driver was only doing this
    accidentally anyway, but if any code relies on this
    misfeature, it now also works in compat mode.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • In order to move socket ioctl conversion code into multiple
    places in the socket code, we need a common defintion of
    the data structures it uses.

    Also change the name from ifreq32 to compat_ifreq to
    follow the naming convention for compat.h

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • David S. Miller
     

06 Nov, 2009

27 commits