Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16b90578 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull vfs updates from Al Viro:
 "This the bunch that sat in -next + lock_parent() fix.  This is the
  minimal set; there's more pending stuff.

  In particular, I really hope to get acct.c fixes merged this cycle -
  we need that to deal sanely with delayed-mntput stuff.  In the next
  pile, hopefully - that series is fairly short and localized
  (kernel/acct.c, fs/super.c and fs/namespace.c).  In this pile: more
  iov_iter work.  Most of prereqs for ->splice_write with sane locking
  order are there and Kent's dio rewrite would also fit nicely on top of
  this pile"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (70 commits)
  lock_parent: don't step on stale ->d_parent of all-but-freed one
  kill generic_file_splice_write()
  ceph: switch to iter_file_splice_write()
  shmem: switch to iter_file_splice_write()
  nfs: switch to iter_splice_write_file()
  fs/splice.c: remove unneeded exports
  ocfs2: switch to iter_file_splice_write()
  ->splice_write() via ->write_iter()
  bio_vec-backed iov_iter
  optimize copy_page_{to,from}_iter()
  bury generic_file_aio_{read,write}
  lustre: get rid of messing with iovecs
  ceph: switch to ->write_iter()
  ceph_sync_direct_write: stop poking into iov_iter guts
  ceph_sync_read: stop poking into iov_iter guts
  new helper: copy_page_from_iter()
  fuse: switch to ->write_iter()
  btrfs: switch to ->write_iter()
  ocfs2: switch to ->write_iter()
  xfs: switch to ->write_iter()
  ...
parents 5c02c392 c2338f2d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -196,8 +196,7 @@ prototypes:
	void (*invalidatepage) (struct page *, unsigned int, unsigned int);
	int (*releasepage) (struct page *, int);
	void (*freepage)(struct page *);
	int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
			loff_t offset, unsigned long nr_segs);
	int (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
	int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **,
				unsigned long *);
	int (*migratepage)(struct address_space *, struct page *, struct page *);
@@ -431,6 +430,8 @@ prototypes:
	ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
	ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
	ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
	ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
	ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
	int (*iterate) (struct file *, struct dir_context *);
	unsigned int (*poll) (struct file *, struct poll_table_struct *);
	long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
+9 −4
Original line number Diff line number Diff line
@@ -589,8 +589,7 @@ struct address_space_operations {
	void (*invalidatepage) (struct page *, unsigned int, unsigned int);
	int (*releasepage) (struct page *, int);
	void (*freepage)(struct page *);
	ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
			loff_t offset, unsigned long nr_segs);
	ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
	struct page* (*get_xip_page)(struct address_space *, sector_t,
			int);
	/* migrate the contents of a page to the specified target */
@@ -807,6 +806,8 @@ struct file_operations {
	ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
	ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
	ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
	ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
	ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
	int (*iterate) (struct file *, struct dir_context *);
	unsigned int (*poll) (struct file *, struct poll_table_struct *);
	long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
@@ -837,11 +838,15 @@ otherwise noted.

  read: called by read(2) and related system calls

  aio_read: called by io_submit(2) and other asynchronous I/O operations
  aio_read: vectored, possibly asynchronous read

  read_iter: possibly asynchronous read with iov_iter as destination

  write: called by write(2) and related system calls

  aio_write: called by io_submit(2) and other asynchronous I/O operations
  aio_write: vectored, possibly asynchronous write

  write_iter: possibly asynchronous write with iov_iter as source

  iterate: called when the VFS needs to read the directory contents

+4 −4
Original line number Diff line number Diff line
@@ -284,10 +284,10 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
#endif

static const struct file_operations raw_fops = {
	.read		= do_sync_read,
	.aio_read	= generic_file_aio_read,
	.write		= do_sync_write,
	.aio_write	= blkdev_aio_write,
	.read		= new_sync_read,
	.read_iter	= generic_file_read_iter,
	.write		= new_sync_write,
	.write_iter	= blkdev_write_iter,
	.fsync		= blkdev_fsync,
	.open		= raw_open,
	.release	= raw_release,
+2 −2
Original line number Diff line number Diff line
@@ -575,12 +575,12 @@ static int alloc_device(struct nandsim *ns)
		cfile = filp_open(cache_file, O_CREAT | O_RDWR | O_LARGEFILE, 0600);
		if (IS_ERR(cfile))
			return PTR_ERR(cfile);
		if (!cfile->f_op->read && !cfile->f_op->aio_read) {
		if (!(cfile->f_mode & FMODE_CAN_READ)) {
			NS_ERR("alloc_device: cache file not readable\n");
			err = -EINVAL;
			goto err_close;
		}
		if (!cfile->f_op->write && !cfile->f_op->aio_write) {
		if (!(cfile->f_mode & FMODE_CAN_WRITE)) {
			NS_ERR("alloc_device: cache file not writeable\n");
			err = -EINVAL;
			goto err_close;
+1 −10
Original line number Diff line number Diff line
@@ -82,16 +82,7 @@ struct ccc_io {
	/**
	 * I/O vector information to or from which read/write is going.
	 */
	struct iovec *cui_iov;
	unsigned long cui_nrsegs;
	/**
	 * Total iov count for left IO.
	 */
	unsigned long cui_tot_nrsegs;
	/**
	 * Old length for iov that was truncated partially.
	 */
	size_t cui_iov_olen;
	struct iov_iter *cui_iter;
	/**
	 * Total size for the left IO.
	 */
Loading