summaryrefslogtreecommitdiffstats
path: root/mm/page_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
commit16b9057804c02e2d351e9c8f606e909b43cbd9e7 (patch)
treea3ac6e1d9d57a8abf4267e5ead3f2de1309335eb /mm/page_io.c
parent5c02c392cd2320e8d612376d6b72b6548a680923 (diff)
parentc2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "This the bunch that sat in -next + lock_parent() fix. This is the minimal set; there's more pending stuff. In particular, I really hope to get acct.c fixes merged this cycle - we need that to deal sanely with delayed-mntput stuff. In the next pile, hopefully - that series is fairly short and localized (kernel/acct.c, fs/super.c and fs/namespace.c). In this pile: more iov_iter work. Most of prereqs for ->splice_write with sane locking order are there and Kent's dio rewrite would also fit nicely on top of this pile" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (70 commits) lock_parent: don't step on stale ->d_parent of all-but-freed one kill generic_file_splice_write() ceph: switch to iter_file_splice_write() shmem: switch to iter_file_splice_write() nfs: switch to iter_splice_write_file() fs/splice.c: remove unneeded exports ocfs2: switch to iter_file_splice_write() ->splice_write() via ->write_iter() bio_vec-backed iov_iter optimize copy_page_{to,from}_iter() bury generic_file_aio_{read,write} lustre: get rid of messing with iovecs ceph: switch to ->write_iter() ceph_sync_direct_write: stop poking into iov_iter guts ceph_sync_read: stop poking into iov_iter guts new helper: copy_page_from_iter() fuse: switch to ->write_iter() btrfs: switch to ->write_iter() ocfs2: switch to ->write_iter() xfs: switch to ->write_iter() ...
Diffstat (limited to 'mm/page_io.c')
-rw-r--r--mm/page_io.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index 58b50d2901fe..243a9b76e5ce 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -264,9 +264,17 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
264 struct kiocb kiocb; 264 struct kiocb kiocb;
265 struct file *swap_file = sis->swap_file; 265 struct file *swap_file = sis->swap_file;
266 struct address_space *mapping = swap_file->f_mapping; 266 struct address_space *mapping = swap_file->f_mapping;
267 struct iovec iov = { 267 struct bio_vec bv = {
268 .iov_base = kmap(page), 268 .bv_page = page,
269 .iov_len = PAGE_SIZE, 269 .bv_len = PAGE_SIZE,
270 .bv_offset = 0
271 };
272 struct iov_iter from = {
273 .type = ITER_BVEC | WRITE,
274 .count = PAGE_SIZE,
275 .iov_offset = 0,
276 .nr_segs = 1,
277 .bvec = &bv
270 }; 278 };
271 279
272 init_sync_kiocb(&kiocb, swap_file); 280 init_sync_kiocb(&kiocb, swap_file);
@@ -275,10 +283,9 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
275 283
276 set_page_writeback(page); 284 set_page_writeback(page);
277 unlock_page(page); 285 unlock_page(page);
278 ret = mapping->a_ops->direct_IO(KERNEL_WRITE, 286 ret = mapping->a_ops->direct_IO(ITER_BVEC | WRITE,
279 &kiocb, &iov, 287 &kiocb, &from,
280 kiocb.ki_pos, 1); 288 kiocb.ki_pos);
281 kunmap(page);
282 if (ret == PAGE_SIZE) { 289 if (ret == PAGE_SIZE) {
283 count_vm_event(PSWPOUT); 290 count_vm_event(PSWPOUT);
284 ret = 0; 291 ret = 0;