Skip to content

iov_iter: Adjust styling/location of new splice functions

David Howells linux-block linux-fsdevel linux-mm linux-unionfs lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 6 repliesIn review
  2. v24 patches 5 repliesSuperseded
  3. v14 patches 5 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5splice: Rename new splice functionsfs/splice.c+8 -90 replies
2/5splice: Provide pipe_head_buf() helperfs/splice.c include/linux/pipe_fs_i.h+23 -60 replies
3/5splice: Use init_sync_kiocb() in filemap_splice_read()fs/splice.c+3 -40 replies
4/5splice: Move filemap_read_splice() to mm/filemap.cfs/splice.c include/linux/pagemap.h include/linux/splice.h +1 more+135 -1350 replies
5/5shmem, overlayfs, coda, tty, proc, kernfs, random: Fix splice-readdrivers/char/random.c drivers/tty/tty_io.c fs/coda/file.c +11 more+221 -243 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigGreg Kroah-HartmanDaniel Golle
1/5Requested-by R-b
2/5Requested-by R-b
3/5Requested-by
4/5Requested-by R-b
5/5A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/5] iov_iter: Adjust styling/location of new splice functions

Hi Jens, Al, Christoph,

Here are patches to make some changes that Christoph requested[1] to the new generic file splice functions that I implemented[2]. Apart from one functional change, they just altering the styling and move one of the functions to a different file:

(1) Rename the main functions:

	generic_file_buffered_splice_read() -> filemap_splice_read()
	generic_file_direct_splice_read()   -> direct_splice_read()

(2) Abstract out the calculation of the location of the head pipe buffer into a helper function in linux/pipe_fs_i.h.

(3) Use init_sync_kiocb() in filemap_splice_read().

This is where the functional change is. Some kiocb fields are then filled in where they were set to 0 before, including setting ki_flags from f_iocb_flags.

(4) Move filemap_splice_read() to mm/filemap.c. filemap_get_pages() can then be made static again.

(5) Fix splice-read for a number of filesystems that don't provide a

     ->read_folio() op and for which filemap_get_pages() cannot be used.

I've pushed the patches here also:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-extract-3

I've also updated worked the changes into the commits on my iov-extract branch if that would be preferable, though that means Jens would need to update his for-6.3/iov-extract again.

David

Changes
=======
ver #3)
- Fix filesystems/drivers that don't have ->read_folio().

ver #2)
- Don't attempt to filter IOCB_* flags in filemap_splice_read().

David Howells (5):
splice: Rename new splice functions
splice: Provide pipe_head_buf() helper
splice: Use init_sync_kiocb() in filemap_splice_read()
splice: Move filemap_read_splice() to mm/filemap.c shmem, overlayfs, coda, tty, proc, kernfs, random: Fix splice-read

 drivers/char/random.c     |   4 +-
 drivers/tty/tty_io.c      |   4 +-
 fs/coda/file.c            |  36 +++++++++-
 fs/kernfs/file.c          |   2 +-
 fs/overlayfs/file.c       |  36 +++++++++-
 fs/proc/inode.c           |   4 +-
 fs/proc/proc_sysctl.c     |   2 +-
 fs/proc_namespace.c       |   6 +-
 fs/splice.c               | 146 ++------------------------------------
 include/linux/fs.h        |   6 ++
 include/linux/pagemap.h   |   2 -
 include/linux/pipe_fs_i.h |  20 ++++++
 mm/filemap.c              | 136 +++++++++++++++++++++++++++++++++--
 mm/internal.h             |   6 ++
 mm/shmem.c                | 124 +++++++++++++++++++++++++++++++-
 15 files changed, 373 insertions(+), 161 deletions(-)