projects/linux·commit fa927894

Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

fa927894 · Linus Torvalds <[email protected]> · 2015-04-15 13:22:56 -07:00

Pull second vfs update from Al Viro:
 "Now that net-next went in...  Here's the next big chunk - killing
  ->aio_read() and ->aio_write().

  There'll be one more pile today (direct_IO changes and
  generic_write_checks() cleanups/fixes), but I'd prefer to keep that
  one separate"

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits)
  ->aio_read and ->aio_write removed
  pcm: another weird API abuse
  infinibad: weird APIs switched to ->write_iter()
  kill do_sync_read/do_sync_write
  fuse: use iov_iter_get_pages() for non-splice path
  fuse: switch to ->read_iter/->write_iter
  switch drivers/char/mem.c to ->read_iter/->write_iter
  make new_sync_{read,write}() static
  coredump: accept any write method
  switch /dev/loop to vfs_iter_write()
  serial2002: switch to __vfs_read/__vfs_write
  ashmem: use __vfs_read()
  export __vfs_read()
  autofs: switch to __vfs_write()
  new helper: __vfs_write()
  switch hugetlbfs to ->read_iter()
  coda: switch to ->read_iter/->write_iter
  ncpfs: switch to ->read_iter/->write_iter
  net/9p: remove (now-)unused helpers
  p9_client_attach(): set fid->uid correctly
  ...
Commit
fa927894bbb4a4c7669c72bad1924991022fda38
Parents
c841e12a · 84363182

Merge commit. Changes below are compared with the first parent: c841e12a.

Changes

90 files changed · +598 −1185

FileStatusAddDelContent
Documentation/filesystems/Lockingmodified+0−2View file
Documentation/filesystems/portingmodified+12−0View file
Documentation/filesystems/vfs.txtmodified+0−6View file
arch/s390/hypfs/inode.cmodified+0−2View file
drivers/block/loop.cmodified+7−5View file
drivers/char/mem.cmodified+9−11View file
drivers/char/raw.cmodified+0−2View file
drivers/infiniband/hw/ipath/ipath_file_ops.cmodified+11−7View file
drivers/infiniband/hw/qib/qib_file_ops.cmodified+12−8View file
drivers/net/macvtap.cmodified+0−2View file
drivers/net/tun.cmodified+0−2View file
drivers/staging/android/ashmem.cmodified+1−1View file
drivers/staging/comedi/drivers/serial2002.cmodified+6−12View file
drivers/staging/lustre/lustre/llite/file.cmodified+0−6View file
drivers/staging/lustre/lustre/llite/llite_internal.hmodified+0−2View file
drivers/usb/gadget/function/f_fs.cmodified+0−2View file
drivers/usb/gadget/legacy/inode.cmodified+0−2View file
fs/9p/v9fs_vfs.hmodified+0−4View file
fs/9p/vfs_addr.cmodified+37−43View file
fs/9p/vfs_dir.cmodified+11−4View file
fs/9p/vfs_file.cmodified+54−260View file
fs/9p/xattr.cmodified+25−55View file
fs/adfs/file.cmodified+0−2View file
fs/affs/file.cmodified+0−2View file
fs/afs/file.cmodified+0−2View file
fs/aio.cmodified+3−20View file
fs/autofs4/autofs_i.hmodified+1−1View file
fs/autofs4/waitq.cmodified+1−1View file
fs/bfs/file.cmodified+0−2View file
fs/block_dev.cmodified+0−2View file
fs/btrfs/file.cmodified+0−2View file
fs/ceph/file.cmodified+0−2View file
fs/cifs/cifsfs.cmodified+0−12View file
fs/coda/file.cmodified+13−25View file
fs/coredump.cmodified+1−1View file
fs/ecryptfs/file.cmodified+0−2View file
fs/exofs/file.cmodified+0−2View file
fs/ext2/file.cmodified+0−4View file
fs/ext3/file.cmodified+0−2View file
fs/ext4/file.cmodified+0−4View file
fs/f2fs/file.cmodified+0−2View file
fs/fat/file.cmodified+0−2View file
fs/file_table.cmodified+2−2View file
fs/fuse/cuse.cmodified+8−17View file
fs/fuse/dev.cmodified+29−34View file
fs/fuse/file.cmodified+26−43View file
fs/gfs2/file.cmodified+0−4View file
fs/hfs/inode.cmodified+0−2View file
fs/hfsplus/inode.cmodified+0−2View file
fs/hostfs/hostfs_kern.cmodified+0−2View file
fs/hpfs/file.cmodified+0−2View file
fs/hugetlbfs/inode.cmodified+33−58View file
fs/jffs2/file.cmodified+0−2View file
fs/jfs/file.cmodified+0−2View file
fs/logfs/file.cmodified+0−2View file
fs/minix/file.cmodified+0−2View file
fs/ncpfs/file.cmodified+31−59View file
fs/ncpfs/ncplib_kernel.cmodified+3−3View file
fs/ncpfs/ncplib_kernel.hmodified+1−1View file
fs/nfs/file.cmodified+0−2View file
fs/nfs/nfs4file.cmodified+0−2View file
fs/nilfs2/file.cmodified+0−2View file
fs/ntfs/file.cmodified+0−2View file
fs/ocfs2/file.cmodified+0−4View file
fs/omfs/file.cmodified+0−2View file
fs/open.cmodified+2−2View file
fs/pipe.cmodified+0−2View file
fs/ramfs/file-mmu.cmodified+0−2View file
fs/ramfs/file-nommu.cmodified+0−2View file
fs/read_write.cmodified+19−90View file
fs/reiserfs/file.cmodified+0−2View file
fs/romfs/mmap-nommu.cmodified+0−1View file
fs/sysv/file.cmodified+0−2View file
fs/ubifs/file.cmodified+0−2View file
fs/udf/file.cmodified+0−2View file
fs/ufs/file.cmodified+0−2View file
fs/xfs/xfs_file.cmodified+0−2View file
include/linux/fs.hmodified+1−6View file
include/net/9p/client.hmodified+4−4View file
include/net/9p/transport.hmodified+1−1View file
kernel/acct.cmodified+1−1View file
mm/nommu.cmodified+2−2View file
mm/shmem.cmodified+0−2View file
net/9p/client.cmodified+123−139View file
net/9p/protocol.cmodified+8−16View file
net/9p/trans_common.cmodified+1−41View file
net/9p/trans_common.hmodified+0−2View file
net/9p/trans_virtio.cmodified+79−58View file
net/socket.cmodified+0−2View file
sound/core/pcm_native.cmodified+20−19View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/filesystems/Locking

View file
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index f91926f..c3cd627 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -429,8 +429,6 @@ prototypes:
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
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 *);

Documentation/filesystems/porting

View file
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index fa2db08..e69274d 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -471,3 +471,15 @@ in your dentry operations instead.
[mandatory]
f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid
it entirely.
+--
+[mandatory]
+ never call ->read() and ->write() directly; use __vfs_{read,write} or
+ wrappers; instead of checking for ->write or ->read being NULL, look for
+ FMODE_CAN_{WRITE,READ} in file->f_mode.
+--
+[mandatory]
+ do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
+ instead.
+--
+[mandatory]
+ ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter.

Documentation/filesystems/vfs.txt

View file
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 966b228..207cdca 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -804,8 +804,6 @@ struct file_operations {
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
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 *);
@@ -838,14 +836,10 @@ otherwise noted.
read: called by read(2) and related system calls
- 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: 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

arch/s390/hypfs/inode.c

View file
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index df7d8cb..3f5c799 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -437,8 +437,6 @@ struct dentry *hypfs_create_str(struct dentry *dir,
static const struct file_operations hypfs_file_ops = {
.open = hypfs_open,
.release = hypfs_release,
- .read = new_sync_read,
- .write = new_sync_write,
.read_iter = hypfs_read_iter,
.write_iter = hypfs_write_iter,
.llseek = no_llseek,

drivers/block/loop.c

View file
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d1f168b..c4fd1e4 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -75,6 +75,7 @@
#include <linux/sysfs.h>
#include <linux/miscdevice.h>
#include <linux/falloc.h>
+#include <linux/uio.h>
#include "loop.h"
#include <asm/uaccess.h>
@@ -229,13 +230,14 @@ lo_do_transfer(struct loop_device *lo, int cmd,
static int __do_lo_send_write(struct file *file,
u8 *buf, const int len, loff_t pos)
{
+ struct kvec kvec = {.iov_base = buf, .iov_len = len};
+ struct iov_iter from;
ssize_t bw;
- mm_segment_t old_fs = get_fs();
+
+ iov_iter_kvec(&from, ITER_KVEC | WRITE, &kvec, 1, len);
file_start_write(file);
- set_fs(get_ds());
- bw = file->f_op->write(file, buf, len, &pos);
- set_fs(old_fs);
+ bw = vfs_iter_write(file, &from, &pos);
file_end_write(file);
if (likely(bw == len))
return 0;
@@ -767,7 +769,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
goto out_putf;
if (!(file->f_mode & FMODE_WRITE) || !(mode & FMODE_WRITE) ||
- !file->f_op->write)
+ !file->f_op->write_iter)
lo_flags |= LO_FLAGS_READ_ONLY;
lo_blocksize = S_ISBLK(inode->i_mode) ?

drivers/char/mem.c

View file
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 9c4fd7a..6b1721f 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -607,16 +607,16 @@ static ssize_t write_null(struct file *file, const char __user *buf,
return count;
}
-static ssize_t aio_read_null(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t pos)
+static ssize_t read_iter_null(struct kiocb *iocb, struct iov_iter *to)
{
return 0;
}
-static ssize_t aio_write_null(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t pos)
+static ssize_t write_iter_null(struct kiocb *iocb, struct iov_iter *from)
{
- return iov_length(iov, nr_segs);
+ size_t count = iov_iter_count(from);
+ iov_iter_advance(from, count);
+ return count;
}
static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
@@ -718,7 +718,7 @@ static int open_port(struct inode *inode, struct file *filp)
#define zero_lseek null_lseek
#define full_lseek null_lseek
#define write_zero write_null
-#define aio_write_zero aio_write_null
+#define write_iter_zero write_iter_null
#define open_mem open_port
#define open_kmem open_mem
@@ -750,8 +750,8 @@ static const struct file_operations null_fops = {
.llseek = null_lseek,
.read = read_null,
.write = write_null,
- .aio_read = aio_read_null,
- .aio_write = aio_write_null,
+ .read_iter = read_iter_null,
+ .write_iter = write_iter_null,
.splice_write = splice_write_null,
};
@@ -764,10 +764,9 @@ static const struct file_operations __maybe_unused port_fops = {
static const struct file_operations zero_fops = {
.llseek = zero_lseek,
- .read = new_sync_read,
.write = write_zero,
.read_iter = read_iter_zero,
- .aio_write = aio_write_zero,
+ .write_iter = write_iter_zero,
.mmap = mmap_zero,
#ifndef CONFIG_MMU
.mmap_capabilities = zero_mmap_capabilities,
@@ -776,7 +775,6 @@ static const struct file_operations zero_fops = {
static const struct file_operations full_fops = {
.llseek = full_lseek,
- .read = new_sync_read,
.read_iter = read_iter_zero,
.write = write_full,
};

drivers/char/raw.c

View file
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 6e29bf2..5fc291c 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -282,9 +282,7 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
#endif
static const struct file_operations raw_fops = {
- .read = new_sync_read,
.read_iter = blkdev_read_iter,
- .write = new_sync_write,
.write_iter = blkdev_write_iter,
.fsync = blkdev_fsync,
.open = raw_open,

drivers/infiniband/hw/ipath/ipath_file_ops.c

View file
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index aed8afe..450d159 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -42,6 +42,7 @@
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/cpu.h>
+#include <linux/uio.h>
#include <asm/pgtable.h>
#include "ipath_kernel.h"
@@ -52,15 +53,19 @@ static int ipath_open(struct inode *, struct file *);
static int ipath_close(struct inode *, struct file *);
static ssize_t ipath_write(struct file *, const char __user *, size_t,
loff_t *);
-static ssize_t ipath_writev(struct kiocb *, const struct iovec *,
- unsigned long , loff_t);
+static ssize_t ipath_write_iter(struct kiocb *, struct iov_iter *from);
static unsigned int ipath_poll(struct file *, struct poll_table_struct *);
static int ipath_mmap(struct file *, struct vm_area_struct *);
+/*
+ * This is really, really weird shit - write() and writev() here
+ * have completely unrelated semantics. Sucky userland ABI,
+ * film at 11.
+ */
static const struct file_operations ipath_file_ops = {
.owner = THIS_MODULE,
.write = ipath_write,
- .aio_write = ipath_writev,
+ .write_iter = ipath_write_iter,
.open = ipath_open,
.release = ipath_close,
.poll = ipath_poll,
@@ -2413,18 +2418,17 @@ bail:
return ret;
}
-static ssize_t ipath_writev(struct kiocb *iocb, const struct iovec *iov,
- unsigned long dim, loff_t off)
+static ssize_t ipath_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct file *filp = iocb->ki_filp;
struct ipath_filedata *fp = filp->private_data;
struct ipath_portdata *pd = port_fp(filp);
struct ipath_user_sdma_queue *pq = fp->pq;
- if (!dim)
+ if (!iter_is_iovec(from) || !from->nr_segs)
return -EINVAL;
- return ipath_user_sdma_writev(pd->port_dd, pq, iov, dim);
+ return ipath_user_sdma_writev(pd->port_dd, pq, from->iov, from->nr_segs);
}
static struct class *ipath_class;

drivers/infiniband/hw/qib/qib_file_ops.c

View file
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 14046f5..9ea6c44 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -43,6 +43,7 @@
#include <asm/pgtable.h>
#include <linux/delay.h>
#include <linux/export.h>
+#include <linux/uio.h>
#include "qib.h"
#include "qib_common.h"
@@ -54,15 +55,19 @@
static int qib_open(struct inode *, struct file *);
static int qib_close(struct inode *, struct file *);
static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *);
-static ssize_t qib_aio_write(struct kiocb *, const struct iovec *,
- unsigned long, loff_t);
+static ssize_t qib_write_iter(struct kiocb *, struct iov_iter *);
static unsigned int qib_poll(struct file *, struct poll_table_struct *);
static int qib_mmapf(struct file *, struct vm_area_struct *);
+/*
+ * This is really, really weird shit - write() and writev() here
+ * have completely unrelated semantics. Sucky userland ABI,
+ * film at 11.
+ */
static const struct file_operations qib_file_ops = {
.owner = THIS_MODULE,
.write = qib_write,
- .aio_write = qib_aio_write,
+ .write_iter = qib_write_iter,
.open = qib_open,
.release = qib_close,
.poll = qib_poll,
@@ -2248,17 +2253,16 @@ bail:
return ret;
}
-static ssize_t qib_aio_write(struct kiocb *iocb, const struct iovec *iov,
- unsigned long dim, loff_t off)
+static ssize_t qib_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct qib_filedata *fp = iocb->ki_filp->private_data;
struct qib_ctxtdata *rcd = ctxt_fp(iocb->ki_filp);
struct qib_user_sdma_queue *pq = fp->pq;
- if (!dim || !pq)
+ if (!iter_is_iovec(from) || !from->nr_segs || !pq)
return -EINVAL;
-
- return qib_user_sdma_writev(rcd, pq, iov, dim);
+
+ return qib_user_sdma_writev(rcd, pq, from->iov, from->nr_segs);
}
static struct class *qib_class;

drivers/net/macvtap.c

View file
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 8362aef..9c91ff8 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -1118,8 +1118,6 @@ static const struct file_operations macvtap_fops = {
.owner = THIS_MODULE,
.open = macvtap_open,
.release = macvtap_release,
- .read = new_sync_read,
- .write = new_sync_write,
.read_iter = macvtap_read_iter,
.write_iter = macvtap_write_iter,
.poll = macvtap_poll,

drivers/net/tun.c

View file
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index b96b94c..e470ae5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2223,8 +2223,6 @@ static void tun_chr_show_fdinfo(struct seq_file *m, struct file *f)
static const struct file_operations tun_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .read = new_sync_read,
- .write = new_sync_write,
.read_iter = tun_chr_read_iter,
.write_iter = tun_chr_write_iter,
.poll = tun_chr_poll,

drivers/staging/android/ashmem.c

View file
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index d140b73..c5c037c 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -310,7 +310,7 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
* be destroyed until all references to the file are dropped and
* ashmem_release is called.
*/
- ret = asma->file->f_op->read(asma->file, buf, len, pos);
+ ret = __vfs_read(asma->file, buf, len, pos);
if (ret >= 0) {
/** Update backing file pos, since f_ops->read() doesn't */
asma->file->f_pos = *pos;

drivers/staging/comedi/drivers/serial2002.c

View file
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index ad35ed6..304ebff 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -108,24 +108,16 @@ static int serial2002_tty_write(struct file *f, unsigned char *buf, int count)
{
const char __user *p = (__force const char __user *)buf;
int result;
+ loff_t offset = 0;
mm_segment_t oldfs;
oldfs = get_fs();
set_fs(KERNEL_DS);
- f->f_pos = 0;
- result = f->f_op->write(f, p, count, &f->f_pos);
+ result = __vfs_write(f, p, count, &offset);
set_fs(oldfs);
return result;
}
-static int serial2002_tty_readb(struct file *f, unsigned char *buf)
-{
- char __user *p = (__force char __user *)buf;
-
- f->f_pos = 0;
- return f->f_op->read(f, p, 1, &f->f_pos);
-}
-
static void serial2002_tty_read_poll_wait(struct file *f, int timeout)
{
struct poll_wqueues table;
@@ -161,13 +153,15 @@ static int serial2002_tty_read(struct file *f, int timeout)
result = -1;
if (!IS_ERR(f)) {
mm_segment_t oldfs;
+ char __user *p = (__force char __user *)&ch;
+ loff_t offset = 0;
oldfs = get_fs();
set_fs(KERNEL_DS);
if (f->f_op->poll) {
serial2002_tty_read_poll_wait(f, timeout);
- if (serial2002_tty_readb(f, &ch) == 1)
+ if (__vfs_read(f, p, 1, &offset) == 1)
result = ch;
} else {
/* Device does not support poll, busy wait */
@@ -178,7 +172,7 @@ static int serial2002_tty_read(struct file *f, int timeout)
if (retries >= timeout)
break;
- if (serial2002_tty_readb(f, &ch) == 1) {
+ if (__vfs_read(f, p, 1, &offset) == 1) {
result = ch;
break;
}

drivers/staging/lustre/lustre/llite/file.c

View file
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 85e74d1..529062e 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3135,9 +3135,7 @@ int ll_inode_permission(struct inode *inode, int mask)
/* -o localflock - only provides locally consistent flock locks */
struct file_operations ll_file_operations = {
- .read = new_sync_read,
.read_iter = ll_file_read_iter,
- .write = new_sync_write,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
.open = ll_file_open,
@@ -3150,9 +3148,7 @@ struct file_operations ll_file_operations = {
};
struct file_operations ll_file_operations_flock = {
- .read = new_sync_read,
.read_iter = ll_file_read_iter,
- .write = new_sync_write,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
.open = ll_file_open,
@@ -3168,9 +3164,7 @@ struct file_operations ll_file_operations_flock = {
/* These are for -o noflock - to return ENOSYS on flock calls */
struct file_operations ll_file_operations_noflock = {
- .read = new_sync_read,
.read_iter = ll_file_read_iter,
- .write = new_sync_write,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
.open = ll_file_open,

drivers/staging/lustre/lustre/llite/llite_internal.h

View file
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 2af1d72..e7422f5 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -938,10 +938,8 @@ struct ll_cl_context {
};
struct vvp_thread_info {
- struct iovec vti_local_iov;
struct vvp_io_args vti_args;
struct ra_io_arg vti_ria;
- struct kiocb vti_kiocb;
struct ll_cl_context vti_io_ctx;
};

drivers/usb/gadget/function/f_fs.c

View file
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index a12315a..6bdb570 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -1061,8 +1061,6 @@ static const struct file_operations ffs_epfile_operations = {
.llseek = no_llseek,
.open = ffs_epfile_open,
- .write = new_sync_write,
- .read = new_sync_read,
.write_iter = ffs_epfile_write_iter,
.read_iter = ffs_epfile_read_iter,
.release = ffs_epfile_release,

drivers/usb/gadget/legacy/inode.c

View file
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 662ef2c..6af58c6 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -699,8 +699,6 @@ static const struct file_operations ep_io_operations = {
.open = ep_open,
.release = ep_release,
.llseek = no_llseek,
- .read = new_sync_read,
- .write = new_sync_write,
.unlocked_ioctl = ep_ioctl,
.read_iter = ep_read_iter,
.write_iter = ep_write_iter,

fs/9p/v9fs_vfs.h

View file
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h
index b83ebfb..5a0db6d 100644
--- a/fs/9p/v9fs_vfs.h
+++ b/fs/9p/v9fs_vfs.h
@@ -68,14 +68,10 @@ int v9fs_file_open(struct inode *inode, struct file *file);
void v9fs_inode2stat(struct inode *inode, struct p9_wstat *stat);
int v9fs_uflags2omode(int uflags, int extended);
-ssize_t v9fs_file_readn(struct file *, char *, char __user *, u32, u64);
-ssize_t v9fs_fid_readn(struct p9_fid *, char *, char __user *, u32, u64);
void v9fs_blank_wstat(struct p9_wstat *wstat);
int v9fs_vfs_setattr_dotl(struct dentry *, struct iattr *);
int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end,
int datasync);
-ssize_t v9fs_file_write_internal(struct inode *, struct p9_fid *,
- const char __user *, size_t, loff_t *, int);
int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode);
int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode);
static inline void v9fs_invalidate_inode_attr(struct inode *inode)

fs/9p/vfs_addr.c

View file
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index ff1a5ba..2e38f9a 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -51,12 +51,11 @@
*/
static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
{
- int retval;
- loff_t offset;
- char *buffer;
- struct inode *inode;
+ struct inode *inode = page->mapping->host;
+ struct bio_vec bvec = {.bv_page = page, .bv_len = PAGE_SIZE};
+ struct iov_iter to;
+ int retval, err;
- inode = page->mapping->host;
p9_debug(P9_DEBUG_VFS, "\n");
BUG_ON(!PageLocked(page));
@@ -65,16 +64,16 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
if (retval == 0)
return retval;
- buffer = kmap(page);
- offset = page_offset(page);
+ iov_iter_bvec(&to, ITER_BVEC | READ, &bvec, 1, PAGE_SIZE);
- retval = v9fs_fid_readn(fid, buffer, NULL, PAGE_CACHE_SIZE, offset);
- if (retval < 0) {
+ retval = p9_client_read(fid, page_offset(page), &to, &err);
+ if (err) {
v9fs_uncache_page(inode, page);
+ retval = err;
goto done;
}
- memset(buffer + retval, 0, PAGE_CACHE_SIZE - retval);
+ zero_user(page, retval, PAGE_SIZE - retval);
flush_dcache_page(page);
SetPageUptodate(page);
@@ -82,7 +81,6 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
retval = 0;
done:
- kunmap(page);
unlock_page(page);
return retval;
}
@@ -161,41 +159,32 @@ static void v9fs_invalidate_page(struct page *page, unsigned int offset,
static int v9fs_vfs_writepage_locked(struct page *page)
{
- char *buffer;
- int retval, len;
- loff_t offset, size;
- mm_segment_t old_fs;
- struct v9fs_inode *v9inode;
struct inode *inode = page->mapping->host;
+ struct v9fs_inode *v9inode = V9FS_I(inode);
+ loff_t size = i_size_read(inode);
+ struct iov_iter from;
+ struct bio_vec bvec;
+ int err, len;
- v9inode = V9FS_I(inode);
- size = i_size_read(inode);
if (page->index == size >> PAGE_CACHE_SHIFT)
len = size & ~PAGE_CACHE_MASK;
else
len = PAGE_CACHE_SIZE;
- set_page_writeback(page);
-
- buffer = kmap(page);
- offset = page_offset(page);
+ bvec.bv_page = page;
+ bvec.bv_offset = 0;
+ bvec.bv_len = len;
+ iov_iter_bvec(&from, ITER_BVEC | WRITE, &bvec, 1, len);
- old_fs = get_fs();
- set_fs(get_ds());
/* We should have writeback_fid always set */
BUG_ON(!v9inode->writeback_fid);
- retval = v9fs_file_write_internal(inode,
- v9inode->writeback_fid,
- (__force const char __user *)buffer,
- len, &offset, 0);
- if (retval > 0)
- retval = 0;
+ set_page_writeback(page);
+
+ p9_client_write(v9inode->writeback_fid, page_offset(page), &from, &err);
- set_fs(old_fs);
- kunmap(page);
end_page_writeback(page);
- return retval;

This diff is incomplete. Download the complete patch.

fs/9p/vfs_dir.c

View file

This diff is incomplete. Download the complete patch.

fs/9p/vfs_file.c

View file

This diff is incomplete. Download the complete patch.

fs/9p/xattr.c

View file

This diff is incomplete. Download the complete patch.

fs/adfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/affs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/afs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/aio.c

View file

This diff is incomplete. Download the complete patch.

fs/autofs4/autofs_i.h

View file

This diff is incomplete. Download the complete patch.

fs/autofs4/waitq.c

View file

This diff is incomplete. Download the complete patch.

fs/bfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/block_dev.c

View file

This diff is incomplete. Download the complete patch.

fs/btrfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ceph/file.c

View file

This diff is incomplete. Download the complete patch.

fs/cifs/cifsfs.c

View file

This diff is incomplete. Download the complete patch.

fs/coda/file.c

View file

This diff is incomplete. Download the complete patch.

fs/coredump.c

View file

This diff is incomplete. Download the complete patch.

fs/ecryptfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/exofs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ext2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ext4/file.c

View file

This diff is incomplete. Download the complete patch.

fs/f2fs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/fat/file.c

View file

This diff is incomplete. Download the complete patch.

fs/file_table.c

View file

This diff is incomplete. Download the complete patch.

fs/fuse/cuse.c

View file

This diff is incomplete. Download the complete patch.

fs/fuse/dev.c

View file

This diff is incomplete. Download the complete patch.

fs/fuse/file.c

View file

This diff is incomplete. Download the complete patch.

fs/gfs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/hfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/hfsplus/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/hostfs/hostfs_kern.c

View file

This diff is incomplete. Download the complete patch.

fs/hpfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/hugetlbfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/jfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/logfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/minix/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ncpfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ncpfs/ncplib_kernel.c

View file

This diff is incomplete. Download the complete patch.

fs/ncpfs/ncplib_kernel.h

View file

This diff is incomplete. Download the complete patch.

fs/nfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/nfs/nfs4file.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ntfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/omfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/open.c

View file

This diff is incomplete. Download the complete patch.

fs/pipe.c

View file

This diff is incomplete. Download the complete patch.

fs/ramfs/file-mmu.c

View file

This diff is incomplete. Download the complete patch.

fs/ramfs/file-nommu.c

View file

This diff is incomplete. Download the complete patch.

fs/read_write.c

View file

This diff is incomplete. Download the complete patch.

fs/reiserfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/romfs/mmap-nommu.c

View file

This diff is incomplete. Download the complete patch.

fs/sysv/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ubifs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/udf/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_file.c

View file

This diff is incomplete. Download the complete patch.

include/linux/fs.h

View file

This diff is incomplete. Download the complete patch.

include/net/9p/client.h

View file

This diff is incomplete. Download the complete patch.

include/net/9p/transport.h

View file

This diff is incomplete. Download the complete patch.

kernel/acct.c

View file

This diff is incomplete. Download the complete patch.

mm/nommu.c

View file

This diff is incomplete. Download the complete patch.

mm/shmem.c

View file

This diff is incomplete. Download the complete patch.

net/9p/client.c

View file

This diff is incomplete. Download the complete patch.

net/9p/protocol.c

View file

This diff is incomplete. Download the complete patch.

net/9p/trans_common.c

View file

This diff is incomplete. Download the complete patch.

net/9p/trans_common.h

View file

This diff is incomplete. Download the complete patch.

net/9p/trans_virtio.c

View file

This diff is incomplete. Download the complete patch.

net/socket.c

View file

This diff is incomplete. Download the complete patch.

sound/core/pcm_native.c

View file

This diff is incomplete. Download the complete patch.