aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-04 21:27:34 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:32:44 -0400
commitd8d3d94b80aa1a1c0ca75c58b8abdc7356f38418 (patch)
tree132f846b04371426b8795475597846aae75e7e07 /mm
parentcb66a7a1f149ff705fa37cad6d1252b046e0ad4f (diff)
pass iov_iter to ->direct_IO()
unmodified, for now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c9
-rw-r--r--mm/page_io.c6
2 files changed, 8 insertions, 7 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 7c1417b0bd7b..139641274f1e 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1699,10 +1699,9 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1699 size = i_size_read(inode); 1699 size = i_size_read(inode);
1700 retval = filemap_write_and_wait_range(mapping, pos, 1700 retval = filemap_write_and_wait_range(mapping, pos,
1701 pos + iov_length(iov, nr_segs) - 1); 1701 pos + iov_length(iov, nr_segs) - 1);
1702 if (!retval) { 1702 if (!retval)
1703 retval = mapping->a_ops->direct_IO(READ, iocb, 1703 retval = mapping->a_ops->direct_IO(READ, iocb, &i, pos);
1704 iov, pos, nr_segs); 1704
1705 }
1706 if (retval > 0) { 1705 if (retval > 0) {
1707 *ppos = pos + retval; 1706 *ppos = pos + retval;
1708 count -= retval; 1707 count -= retval;
@@ -2383,7 +2382,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from,
2383 } 2382 }
2384 } 2383 }
2385 2384
2386 written = mapping->a_ops->direct_IO(WRITE, iocb, from->iov, pos, from->nr_segs); 2385 written = mapping->a_ops->direct_IO(WRITE, iocb, from, pos);
2387 2386
2388 /* 2387 /*
2389 * Finally, try again to invalidate clean pages which might have been 2388 * Finally, try again to invalidate clean pages which might have been
diff --git a/mm/page_io.c b/mm/page_io.c
index 7c59ef681381..0ed0644c73db 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -263,16 +263,18 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
263 .iov_base = kmap(page), 263 .iov_base = kmap(page),
264 .iov_len = PAGE_SIZE, 264 .iov_len = PAGE_SIZE,
265 }; 265 };
266 struct iov_iter from;
266 267
267 init_sync_kiocb(&kiocb, swap_file); 268 init_sync_kiocb(&kiocb, swap_file);
268 kiocb.ki_pos = page_file_offset(page); 269 kiocb.ki_pos = page_file_offset(page);
269 kiocb.ki_nbytes = PAGE_SIZE; 270 kiocb.ki_nbytes = PAGE_SIZE;
271 iov_iter_init(&from, &iov, 1, PAGE_SIZE, 0);
270 272
271 set_page_writeback(page); 273 set_page_writeback(page);
272 unlock_page(page); 274 unlock_page(page);
273 ret = mapping->a_ops->direct_IO(KERNEL_WRITE, 275 ret = mapping->a_ops->direct_IO(KERNEL_WRITE,
274 &kiocb, &iov, 276 &kiocb, &from,
275 kiocb.ki_pos, 1); 277 kiocb.ki_pos);
276 kunmap(page); 278 kunmap(page);
277 if (ret == PAGE_SIZE) { 279 if (ret == PAGE_SIZE) {
278 count_vm_event(PSWPOUT); 280 count_vm_event(PSWPOUT);