Permalink
Commits on Oct 18, 2013
  1. tmpfs: add support for read_iter and write_iter

    Hugh Dickins committed with kleikamp Oct 15, 2013
    Convert tmpfs do_shmem_file_read() to shmem_file_read_iter().
    Make file_read_iter_actor() global so tmpfs can use it too: delete
    file_read_actor(), which was made global in 2.4.4 for use by tmpfs.
    Replace tmpfs generic_file_aio_write() by generic_file_write_iter().
    
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
  2. ubifs: convert file ops from aio_read/write to read/write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: Artem Bityutskiy <dedekind1@gmail.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: linux-mtd@lists.infradead.org
  3. ecrpytfs: Convert aio_read/write ops to read/write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: Tyler Hicks <tyhicks@canonical.com>
    Cc: Dustin Kirkland <dustin.kirkland@gazzang.com>
    Cc: ecryptfs@vger.kernel.org
  4. afs: add support for read_iter and write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: David Howells <dhowells@redhat.com>
    Cc: linux-afs@lists.infradead.org
  5. udf: convert file ops from aio_read/write to read/write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Jan Kara <jack@suse.cz>
  6. gfs2: Convert aio_read/write ops to read/write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: Steven Whitehouse <swhiteho@redhat.com>
    Cc: cluster-devel@redhat.com
  7. xfs: add support for read_iter and write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Dave Chinner <dchinner@redhat.com>
    Cc: Ben Myers <bpm@sgi.com>
    Cc: Alex Elder <elder@kernel.org>
    Cc: xfs@oss.sgi.com
  8. block_dev: add support for read_iter, write_iter

    Asias He committed with kleikamp Oct 15, 2013
    Signed-off-by: Asias He <asias@redhat.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
  9. btrfs: add support for read_iter and write_iter

    kleikamp committed Oct 15, 2013
    btrfs can use generic_file_read_iter(). Base btrfs_file_write_iter()
    on btrfs_file_aio_write(), then have the latter call the former.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Chris Mason <chris.mason@fusionio.com>
    Cc: linux-btrfs@vger.kernel.org
  10. nfs: simplify swap

    kleikamp committed Oct 15, 2013
    swap_writepage can now call nfs's write_iter f_op, eliminating the need to
    implement for the special-case direct_IO a_op. There is no longer a need to
    pass the uio flag through the direct write path.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Rik van Riel <riel@redhat.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
    Cc: linux-nfs@vger.kernel.org
  11. nfs: add support for read_iter, write_iter

    kleikamp committed Oct 15, 2013
    This patch implements the read_iter and write_iter file operations which
    allow kernel code to initiate directIO. This allows the loop device to
    read and write directly to the server, bypassing the page cache.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
    Cc: linux-nfs@vger.kernel.org
  12. ext4: add support for read_iter and write_iter

    kleikamp committed Oct 15, 2013
    use the generic_file_read_iter(), create ext4_file_write_iter() based on
    ext4_file_write(), and make ext4_file_write() a wrapper around
    ext4_file_write_iter().
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: "Theodore Ts'o" <tytso@mit.edu>
    Cc: Andreas Dilger <adilger.kernel@dilger.ca>
    Cc: linux-ext4@vger.kernel.org
  13. ocfs2: add support for read_iter and write_iter

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Joel Becker <jlbec@evilplan.org>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Mark Fasheh <mfasheh@suse.com>
    Cc: ocfs2-devel@oss.oracle.com
  14. fs: add read_iter and write_iter to several file systems

    kleikamp committed Oct 15, 2013
    These are the simple ones.
    
    File systems that use generic_file_aio_read() and generic_file_aio_write()
    can trivially support generic_file_read_iter() and generic_file_write_iter().
    
    This patch adds those file_operations for 9p, adfs, affs, bfs, exofs, ext2,
    ext3, fat, f2fs, hfs, hfsplus, hostfs, hpfs, jfs, jffs2, logfs, minix, nilfs2,
    omfs, ramfs, reiserfs, romfs, sysv, and ufs.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Boaz Harrosh <bharrosh@panasas.com>
    Cc: Zach Brown <zab@zabbo.net>
  15. fs: use read_iter and write_iter rather than aio_read and aio_write

    kleikamp committed Oct 15, 2013
    File systems implementing read_iter & write_iter should not be required
    to keep aio_read and aio_write as well. The vfs should always call
    read/write_iter if they exist. This will make it easier to remove the
    aio_read/write operation in the future.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Benjamin LaHaise <bcrl@kvack.org>
    Cc: linux-aio@kvack.org
  16. fs: create file_readable() and file_writable() functions

    kleikamp committed Oct 15, 2013
    Create functions to simplify if file_ops contain either a read
    or aio_read op, or likewise write or aio_write. We will be adding
    read_iter and write_iter and don't need to be complicating the code
    in multiple places.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  17. loop: use aio to perform io on the underlying file

    zabbo committed with kleikamp Oct 18, 2013
    This uses the new kernel aio interface to process loopback IO by
    submitting concurrent direct aio.  Previously loop's IO was serialized
    by synchronous processing in a thread.
    
    The aio operations specify the memory for the IO with the bio_vec arrays
    directly instead of mappings of the pages.
    
    The use of aio operations is enabled when the backing file supports the
    read_iter, write_iter and direct_IO methods.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Commits on Oct 15, 2013
  1. bio: add bvec_length(), like iov_length()

    zabbo committed with kleikamp Oct 15, 2013
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  2. aio: add aio support for iov_iter arguments

    kleikamp committed Oct 15, 2013
    This adds iocb cmds which specify that memory is held in iov_iter
    structures.  This lets kernel callers specify memory that can be
    expressed in an iov_iter, which includes pages in bio_vec arrays.
    
    Only kernel callers can provide an iov_iter so it doesn't make a lot of
    sense to expose the IOCB_CMD values for this as part of the user space
    ABI.
    
    But kernel callers should also be able to perform the usual aio
    operations which suggests using the the existing operation namespace and
    support code.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Benjamin LaHaise <bcrl@kvack.org>
    Cc: linux-aio@kvack.org
  3. aio: add aio_kernel_() interface

    kleikamp committed Oct 15, 2013
    This adds an interface that lets kernel callers submit aio iocbs without
    going through the user space syscalls.  This lets kernel callers avoid
    the management limits and overhead of the context.  It will also let us
    integrate aio operations with other kernel apis that the user space
    interface doesn't have access to.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Zach Brown <zab@zabbo.net>
    Cc: Benjamin LaHaise <bcrl@kvack.org>
    Cc: linux-aio@kvack.org
  4. fs: pull iov_iter use higher up the stack

    zabbo committed with kleikamp Oct 15, 2013
    Right now only callers of generic_perform_write() pack their iovec
    arguments into an iov_iter structure.  All the callers higher up in the
    stack work on raw iovec arguments.
    
    This patch introduces the use of the iov_iter abstraction higher up the
    stack.  Private generic path functions are changed to operation on
    iov_iter instead of on raw iovecs.  Exported interfaces that take iovecs
    immediately pack their arguments into an iov_iter and call into the
    shared functions.
    
    File operation struct functions are added with iov_iter as an argument
    so that callers to the generic file system functions can specify
    abstract memory rather than iovec arrays only.
    
    Almost all of this patch only transforms arguments and shouldn't change
    functionality.  The buffered read path is the exception.  We add a
    read_actor function which uses the iov_iter helper functions instead of
    operating on each individual iovec element.  This may improve
    performance as the iov_iter helper can copy multiple iovec elements from
    one mapped page cache page.
    
    As always, the direct IO path is special.  Sadly, it may still be
    cleanest to have it work on the underlying memory structures directly
    instead of working through the iov_iter abstraction.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  5. dio: add bio_vec support to __blockdev_direct_IO()

    kleikamp committed Oct 15, 2013
    The trick here is to initialize the dio state so that do_direct_IO()
    consumes the pages we provide and never tries to map user pages.  This
    is done by making sure that final_block_in_request covers the page that
    we set in the dio.  do_direct_IO() will return before running out of
    pages.
    
    The caller is responsible for dirtying these pages, if needed.  We add
    an option to the dio struct that makes sure we only dirty pages when
    we're operating on iovecs of user addresses.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Zach Brown <zab@zabbo.net>
  6. dio: Convert direct_IO to use iov_iter

    kleikamp committed Oct 15, 2013
    Change the direct_IO aop to take an iov_iter argument rather than an iovec.
    This will get passed down through most filesystems so that only the
    __blockdev_direct_IO helper need be aware of whether user or kernel memory
    is being passed to the function.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  7. iov_iter: let callers extract iovecs and bio_vecs

    zabbo committed with kleikamp Oct 15, 2013
    direct IO treats memory from user iovecs and memory from arrays of
    kernel pages very differently.  User memory is pinned and worked with in
    batches while kernel pages are always pinned and don't require
    additional processing.
    
    Rather than try and provide an abstraction that includes these
    different behaviours we let direct IO extract the memory structs and
    hand them to the existing code.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  8. iov_iter: add a shorten call

    zabbo committed with kleikamp Oct 15, 2013
    The generic direct write path wants to shorten its memory vector.  It
    does this when it finds that it has to perform a partial write due to
    LIMIT_FSIZE.  .direct_IO() always performs IO on all of the referenced
    memory because it doesn't have an argument to specify the length of the
    IO.
    
    We add an iov_iter operation for this so that the generic path can ask
    to shorten the memory vector without having to know what kind it is.
    We're happy to shorten the kernel copy of the iovec array, but we refuse
    to shorten the bio_vec array and return an error in this case.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  9. iov_iter: add bvec support

    zabbo committed with kleikamp Oct 15, 2013
    This adds a set of iov_iter_ops calls which work with memory which is
    specified by an array of bio_vec structs instead of an array of iovec
    structs.
    
    The big difference is that the pages referenced by the bio_vec elements
    are pinned.  They don't need to be faulted in and we can always use
    kmap_atomic() to map them one at a time.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  10. iov_iter: ii_iovec_copy_to_user should pre-fault user pages

    kleikamp committed Oct 15, 2013
    This duplicates the optimization in file_read_actor as a later patch
    will replace it with a call to __iov_iter_copy_to_user().
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  11. iov_iter: hide iovec details behind ops function pointers

    zabbo committed with kleikamp Oct 15, 2013
    This moves the current iov_iter functions behind an ops struct of
    function pointers.  The current iov_iter functions all work with memory
    which is specified by iovec arrays of user space pointers.
    
    This patch is part of a series that lets us specify memory with bio_vec
    arrays of page pointers.  By moving to an iov_iter operation struct we
    can add that support in later patches in this series by adding another
    set of function pointers.
    
    I only came to this after having initialy tried to teach the current
    iov_iter functions about bio_vecs by introducing conditional branches
    that dealt with bio_vecs in all the functions.  It wasn't pretty.  This
    approach seems to be the lesser evil.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  12. fuse: convert fuse to use iov_iter_copy_[to|from]_user

    kleikamp committed Oct 15, 2013
    A future patch hides the internals of struct iov_iter, so fuse should
    be using the supported interface.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Miklos Szeredi <mszeredi@suse.cz>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: fuse-devel@lists.sourceforge.net
  13. iov_iter: add __iovec_copy_to_user()

    kleikamp committed Oct 15, 2013
    This patch adds __iovec_copy_to_user() which doesn't verify write access
    to the user memory to be called from code where that verification has
    already been done.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  14. iov_iter: add copy_to_user support

    zabbo committed with kleikamp Oct 15, 2013
    This adds iov_iter wrappers around copy_to_user() to match the existing
    wrappers around copy_from_user().
    
    This will be used by the generic file system buffered read path.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  15. iov_iter: iov_iter_copy_from_user() should use non-atomic copy

    kleikamp committed Oct 15, 2013
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  16. iov_iter: move into its own file

    zabbo committed with kleikamp Oct 15, 2013
    This moves the iov_iter functions in to their own file.  We're going to
    be working on them in upcoming patches.  They become sufficiently large,
    and remain self-contained, to justify seperating them from the rest of
    the huge mm/filemap.c.
    
    Signed-off-by: Zach Brown <zab@zabbo.net>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
    Acked-by: Jeff Moyer <jmoyer@redhat.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
  17. Merge tag 'vfio-v3.12-rc5' of git://github.com/awilliam/linux-vfio

    torvalds committed Oct 15, 2013
    Pull vfio fix from Alex Williamson:
     "Fix an incorrect break out of nested loop in iommu mapping code"
    
    * tag 'vfio-v3.12-rc5' of git://github.com/awilliam/linux-vfio:
      VFIO: vfio_iommu_type1: fix bug caused by break in nested loop
  18. Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kern…

    torvalds committed Oct 15, 2013
    …el/git/roland/infiniband
    
    Pull infiniband updates from Roland Dreier:
     "Last batch of IB changes for 3.12: many mlx5 hardware driver fixes
      plus one trivial semicolon cleanup"
    
    * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
      IB: Remove unnecessary semicolons
      IB/mlx5: Ensure proper synchronization accessing memory
      IB/mlx5: Fix alignment of reg umr gather buffers
      IB/mlx5: Fix eq names to display nicely in /proc/interrupts
      mlx5: Fix error code translation from firmware to driver
      IB/mlx5: Fix opt param mask according to firmware spec
      mlx5: Fix opt param mask for sq err to rts transition
      IB/mlx5: Disable atomic operations
      mlx5: Fix layout of struct mlx5_init_seg
      mlx5: Keep polling to reclaim pages while any returned
      IB/mlx5: Avoid async events on invalid port number
      IB/mlx5: Decrease memory consumption of mr caches
      mlx5: Remove checksum on command interface commands
      IB/mlx5: Fix memory leak in mlx5_ib_create_srq
      IB/mlx5: Flush cache workqueue before destroying it
      IB/mlx5: Fix send work queue size calculation