aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-05 19:28:09 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:32:49 -0400
commit71d8e532b1549a478e6a6a8a44f309d050294d00 (patch)
tree58b40c17cbb806c94aa07121a8b010d16f825d27 /mm
parented978a811ec528dbe40243605c3afab55892f722 (diff)
start adding the tag to iov_iter
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c4
-rw-r--r--mm/iov_iter.c15
-rw-r--r--mm/page_io.c2
-rw-r--r--mm/process_vm_access.c4
-rw-r--r--mm/shmem.c2
5 files changed, 21 insertions, 6 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index a7f79e90209c..3aeaf2df4135 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1730,7 +1730,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1730 size_t count = iov_length(iov, nr_segs); 1730 size_t count = iov_length(iov, nr_segs);
1731 struct iov_iter i; 1731 struct iov_iter i;
1732 1732
1733 iov_iter_init(&i, iov, nr_segs, count, 0); 1733 iov_iter_init(&i, READ, iov, nr_segs, count);
1734 return generic_file_read_iter(iocb, &i); 1734 return generic_file_read_iter(iocb, &i);
1735} 1735}
1736EXPORT_SYMBOL(generic_file_aio_read); 1736EXPORT_SYMBOL(generic_file_aio_read);
@@ -2596,7 +2596,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
2596 if (err) 2596 if (err)
2597 goto out; 2597 goto out;
2598 2598
2599 iov_iter_init(&from, iov, nr_segs, count, 0); 2599 iov_iter_init(&from, WRITE, iov, nr_segs, count);
2600 2600
2601 /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */ 2601 /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
2602 if (unlikely(file->f_flags & O_DIRECT)) { 2602 if (unlikely(file->f_flags & O_DIRECT)) {
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
index 2f762cc21080..e2c9a2db4350 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -220,3 +220,18 @@ unsigned long iov_iter_alignment(const struct iov_iter *i)
220 return res; 220 return res;
221} 221}
222EXPORT_SYMBOL(iov_iter_alignment); 222EXPORT_SYMBOL(iov_iter_alignment);
223
224void iov_iter_init(struct iov_iter *i, int direction,
225 const struct iovec *iov, unsigned long nr_segs,
226 size_t count)
227{
228 /* It will get better. Eventually... */
229 if (segment_eq(get_fs(), KERNEL_DS))
230 direction |= REQ_KERNEL;
231 i->type = direction;
232 i->iov = iov;
233 i->nr_segs = nr_segs;
234 i->iov_offset = 0;
235 i->count = count;
236}
237EXPORT_SYMBOL(iov_iter_init);
diff --git a/mm/page_io.c b/mm/page_io.c
index 0ed0644c73db..313bfedb75d1 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -268,7 +268,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
268 init_sync_kiocb(&kiocb, swap_file); 268 init_sync_kiocb(&kiocb, swap_file);
269 kiocb.ki_pos = page_file_offset(page); 269 kiocb.ki_pos = page_file_offset(page);
270 kiocb.ki_nbytes = PAGE_SIZE; 270 kiocb.ki_nbytes = PAGE_SIZE;
271 iov_iter_init(&from, &iov, 1, PAGE_SIZE, 0); 271 iov_iter_init(&from, KERNEL_WRITE, &iov, 1, PAGE_SIZE);
272 272
273 set_page_writeback(page); 273 set_page_writeback(page);
274 unlock_page(page); 274 unlock_page(page);
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index f32b1fbbfe69..5077afcd9e11 100644
--- a/mm/process_vm_access.c
+++ b/mm/process_vm_access.c
@@ -274,7 +274,7 @@ static ssize_t process_vm_rw(pid_t pid,
274 if (rc <= 0) 274 if (rc <= 0)
275 goto free_iovecs; 275 goto free_iovecs;
276 276
277 iov_iter_init(&iter, iov_l, liovcnt, rc, 0); 277 iov_iter_init(&iter, vm_write ? WRITE : READ, iov_l, liovcnt, rc);
278 278
279 rc = rw_copy_check_uvector(CHECK_IOVEC_ONLY, rvec, riovcnt, UIO_FASTIOV, 279 rc = rw_copy_check_uvector(CHECK_IOVEC_ONLY, rvec, riovcnt, UIO_FASTIOV,
280 iovstack_r, &iov_r); 280 iovstack_r, &iov_r);
@@ -337,7 +337,7 @@ compat_process_vm_rw(compat_pid_t pid,
337 &iov_l); 337 &iov_l);
338 if (rc <= 0) 338 if (rc <= 0)
339 goto free_iovecs; 339 goto free_iovecs;
340 iov_iter_init(&iter, iov_l, liovcnt, rc, 0); 340 iov_iter_init(&iter, vm_write ? WRITE : READ, iov_l, liovcnt, rc);
341 rc = compat_rw_copy_check_uvector(CHECK_IOVEC_ONLY, rvec, riovcnt, 341 rc = compat_rw_copy_check_uvector(CHECK_IOVEC_ONLY, rvec, riovcnt,
342 UIO_FASTIOV, iovstack_r, 342 UIO_FASTIOV, iovstack_r,
343 &iov_r); 343 &iov_r);
diff --git a/mm/shmem.c b/mm/shmem.c
index 2a93e625adaf..e0b76696c3f9 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1417,7 +1417,7 @@ static ssize_t shmem_file_aio_read(struct kiocb *iocb,
1417 loff_t *ppos = &iocb->ki_pos; 1417 loff_t *ppos = &iocb->ki_pos;
1418 struct iov_iter iter; 1418 struct iov_iter iter;
1419 1419
1420 iov_iter_init(&iter, iov, nr_segs, count, 0); 1420 iov_iter_init(&iter, READ, iov, nr_segs, count);
1421 1421
1422 /* 1422 /*
1423 * Might this read be for a stacking filesystem? Then when reading 1423 * Might this read be for a stacking filesystem? Then when reading