diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-02-11 18:37:41 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:36:00 -0400 |
commit | 293bc9822fa9b3c9d4b7893bcb241e085580771a (patch) | |
tree | 89aae8e9d832199906d413dcffd5b885bcee14fe /fs/open.c | |
parent | 7f7f25e82d54870df24d415a7007fbd327da027b (diff) |
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/open.c')
-rw-r--r-- | fs/open.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -725,9 +725,11 @@ static int do_dentry_open(struct file *f, | |||
725 | } | 725 | } |
726 | if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) | 726 | if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) |
727 | i_readcount_inc(inode); | 727 | i_readcount_inc(inode); |
728 | if ((f->f_mode & FMODE_READ) && likely(f->f_op->read || f->f_op->aio_read)) | 728 | if ((f->f_mode & FMODE_READ) && |
729 | likely(f->f_op->read || f->f_op->aio_read || f->f_op->read_iter)) | ||
729 | f->f_mode |= FMODE_CAN_READ; | 730 | f->f_mode |= FMODE_CAN_READ; |
730 | if ((f->f_mode & FMODE_WRITE) && likely(f->f_op->write || f->f_op->aio_write)) | 731 | if ((f->f_mode & FMODE_WRITE) && |
732 | likely(f->f_op->write || f->f_op->aio_write || f->f_op->write_iter)) | ||
731 | f->f_mode |= FMODE_CAN_WRITE; | 733 | f->f_mode |= FMODE_CAN_WRITE; |
732 | 734 | ||
733 | f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); | 735 | f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); |