summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-05-07bio_vec-backed iov_iterAl Viro5-44/+385
New variant of iov_iter - ITER_BVEC in iter->type, backed with bio_vec array instead of iovec one. Primitives taught to deal with such beasts, __swap_write() switched to using that kind of iov_iter. Note that bio_vec is just a <page, offset, length> triple - there's nothing block-specific about it. I've left the definition where it was, but took it from under ifdef CONFIG_BLOCK. Next target: ->splice_write()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07optimize copy_page_{to,from}_iter()Al Viro1-0/+8
if we'd ended up in the end of a segment, jump to the beginning of the next one (iov_offset = 0, iov++), rather than having the next primitive deal with that. Ought to be folded back... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07bury generic_file_aio_{read,write}Al Viro2-37/+8
no callers left Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07lustre: get rid of messing with iovecsAl Viro7-163/+46
* switch to ->read_iter/->write_iter * keep a pointer to iov_iter instead of iov/nr_segs * do not modify iovecs; use iov_iter_truncate()/iov_iter_advance() and a new primitive - iov_iter_reexpand() (expand previously truncated iterator) istead. * (racy) check for lustre VMAs intersecting with iovecs kept for now as for_each_iov() loop. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ceph: switch to ->write_iter()Al Viro1-31/+26
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ceph_sync_direct_write: stop poking into iov_iter gutsAl Viro1-26/+23
all needed primitives are there... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ceph_sync_read: stop poking into iov_iter gutsAl Viro3-61/+22
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new helper: copy_page_from_iter()Al Viro3-110/+99
parallel to copy_page_to_iter(). pipe_write() switched to it (and became ->write_iter()). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fuse: switch to ->write_iter()Al Viro1-16/+11
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07btrfs: switch to ->write_iter()Al Viro1-14/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ocfs2: switch to ->write_iter()Al Viro1-18/+12
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07xfs: switch to ->write_iter()Al Viro1-20/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07afs: switch to ->write_iter()Al Viro3-10/+8
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07gfs2: switch to ->write_iter()Al Viro1-10/+8
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07nfs: switch to ->write_iter()Al Viro3-12/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ubifs: switch to ->write_iter()Al Viro1-12/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07bury __generic_file_aio_write()Al Viro2-12/+0
all users converted to __generic_file_write_iter() now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07cifs: switch to ->write_iter()Al Viro3-42/+35
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07udf: switch to ->write_iter()Al Viro1-6/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07convert ext4 to ->write_iter()Al Viro1-18/+11
unfortunately, Ted's changes to ext4_file_write() are *still* an incomplete fix - playing with rlimits can let you smuggle an unaligned request past the checks. So there almost certainly will be more merge PITA around that place... [fix from Peter Ujfalusi <peter.ujfalusi@ti.com> folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07Merge ext4 changes in ext4_file_write() into for-nextAl Viro9-250/+244
From ext4.git#dev, needed for switch of ext4 to ->write_iter() ;-/
2014-05-07blkdev_aio_write() - turn into blkdev_write_iter()Al Viro3-14/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07write_iter variants of {__,}generic_file_aio_write()Al Viro29-79/+94
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ceph: switch to ->read_iter()Al Viro1-11/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07nfs: switch to ->read_iter()Al Viro3-14/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fs/block_dev.c: switch to ->read_iter()Al Viro1-10/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07shmem: switch to ->read_iter()Al Viro1-10/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07pipe: switch to ->read_iter()Al Viro1-11/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07cifs: switch to ->read_iter()Al Viro3-32/+22
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fuse_file_aio_read(): convert to ->read_iter()Al Viro1-6/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ocfs2: switch to ->read_iter()Al Viro1-11/+10
tracepoints are evil, exhibit #6969... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07ecryptfs: switch to ->read_iter()Al Viro1-5/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07xfs: switch to ->read_iter()Al Viro1-12/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07switch simple generic_file_aio_read() users to ->read_iter()Al Viro35-75/+75
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new methods: ->read_iter() and ->write_iter()Al Viro7-13/+121
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>
2014-05-07replace checking for ->read/->aio_read presence with check in ->f_modeAl Viro6-11/+23
Since we are about to introduce new methods (read_iter/write_iter), the tests in a bunch of places would have to grow inconveniently. Check once (at open() time) and store results in ->f_mode as FMODE_CAN_READ and FMODE_CAN_WRITE resp. It might end up being a temporary measure - once everything switches from ->aio_{read,write} to ->{read,write}_iter it might make sense to return to open-coded checks. We'll see... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07xfs: trim the argument lists of xfs_file_{dio,buffered}_aio_write()Al Viro1-19/+14
pos is redundant (it's iocb->ki_pos), and iov/nr_segs/count are taken care of by lifting iov_iter into the caller. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07blkdev_aio_read(): switch to generic_file_read_iter(), get rid of iov_shorten()Al Viro1-3/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07iov_iter_truncate()Al Viro7-42/+40
Now It Can Be Done(tm) - we don't need to do iov_shorten() in generic_file_direct_write() anymore, now that all ->direct_IO() instances are converted to proper iov_iter methods and honour iter->count and iter->iov_offset properly. Get rid of count/ocount arguments of generic_file_direct_write(), while we are at it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07btrfs: switch check_direct_IO() to iov_iterAl Viro1-25/+15
... and don't open-code iov_iter_alignment() there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new helper: iov_iter_get_pages_alloc()Al Viro4-257/+167
same as iov_iter_get_pages(), except that pages array is allocated (kmalloc if possible, vmalloc if that fails) and left for caller to free. Lustre and NFS ->direct_IO() switched to it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new helper: iov_iter_npages()Al Viro4-22/+31
counts the pages covered by iov_iter, up to given limit. do_block_direct_io() and fuse_iter_npages() switched to it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07f2fs: switch to iov_iter_alignment()Al Viro1-6/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fuse: switch to iov_iter_get_pages()Al Viro1-21/+12
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fuse: pull iov_iter initializations upAl Viro3-30/+38
... to fuse_direct_{read,write}(). ->direct_IO() path uses the iov_iter passed by the caller instead. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new helper: iov_iter_get_pages()Al Viro3-73/+67
iov_iter_get_pages(iter, pages, maxsize, &start) grabs references pinning the pages of up to maxsize of (contiguous) data from iter. Returns the amount of memory grabbed or -error. In case of success, the requested area begins at offset start in pages[0] and runs through pages[1], etc. Less than requested amount might be returned - either because the contiguous area in the beginning of iterator is smaller than requested, or because the kernel failed to pin that many pages. direct-io.c switched to using iov_iter_get_pages() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07dio: take updating ->result into do_direct_IO()Al Viro1-4/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07start adding the tag to iov_iterAl Viro15-35/+41
For now, just use the same thing we pass to ->direct_IO() - it's all iovec-based at the moment. Pass it explicitly to iov_iter_init() and account for kvec vs. iovec in there, by the same kludge NFS ->direct_IO() uses. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07new helper: generic_file_read_iter()Al Viro4-48/+37
iov_iter-using variant of generic_file_aio_read(). Some callers converted. Note that it's still not quite there for use as ->read_iter() - we depend on having zero iter->iov_offset in O_DIRECT case. Fortunately, that's true for all converted callers (and for generic_file_aio_read() itself). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-07fuse_file_aio_write(): merge initializations of iov_iterAl Viro1-2/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>