summaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-02-11 18:37:41 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:36:00 -0400
commit293bc9822fa9b3c9d4b7893bcb241e085580771a (patch)
tree89aae8e9d832199906d413dcffd5b885bcee14fe /fs/file_table.c
parent7f7f25e82d54870df24d415a7007fbd327da027b (diff)
downloadlinux-293bc9822fa9b3c9d4b7893bcb241e085580771a.tar.bz2
new methods: ->read_iter() and ->write_iter()
Beginning to introduce those. Just the callers for now, and it's clumsier than it'll eventually become; once we finish converting aio_read and aio_write instances, the things will get nicer. For now, these guys are in parallel to ->aio_read() and ->aio_write(); they take iocb and iov_iter, with everything in iov_iter already validated. File offset is passed in iocb->ki_pos, iov/nr_segs - in iov_iter. Main concerns in that series are stack footprint and ability to split the damn thing cleanly. [fix from Peter Ujfalusi <peter.ujfalusi@ti.com> folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index be73cbc48c12..f8cc881fbbfb 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -175,9 +175,11 @@ struct file *alloc_file(struct path *path, fmode_t mode,
file->f_path = *path;
file->f_inode = path->dentry->d_inode;
file->f_mapping = path->dentry->d_inode->i_mapping;
- if ((mode & FMODE_READ) && likely(fop->read || fop->aio_read))
+ if ((mode & FMODE_READ) &&
+ likely(fop->read || fop->aio_read || fop->read_iter))
mode |= FMODE_CAN_READ;
- if ((mode & FMODE_WRITE) && likely(fop->write || fop->aio_write))
+ if ((mode & FMODE_WRITE) &&
+ likely(fop->write || fop->aio_write || fop->write_iter))
mode |= FMODE_CAN_WRITE;
file->f_mode = mode;
file->f_op = fop;