Commit c61c7038 authored by Al Viro's avatar Al Viro

untangling process_vm_..., part 2

move iov to caller's stack frame; the value we assign to it on the
next call of process_vm_rw_pages() is equal to the value it had
when the last time we were leaving process_vm_rw_pages().

drop lvec argument of process_vm_rw_pages() - it's not used anymore.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 480402e1
...@@ -45,7 +45,7 @@ static int process_vm_rw_pages(struct task_struct *task, ...@@ -45,7 +45,7 @@ static int process_vm_rw_pages(struct task_struct *task,
unsigned long pa, unsigned long pa,
unsigned long start_offset, unsigned long start_offset,
unsigned long len, unsigned long len,
const struct iovec *lvec, const struct iovec **iovp,
unsigned long lvec_cnt, unsigned long lvec_cnt,
unsigned long *lvec_current, unsigned long *lvec_current,
size_t *lvec_offset, size_t *lvec_offset,
...@@ -60,7 +60,7 @@ static int process_vm_rw_pages(struct task_struct *task, ...@@ -60,7 +60,7 @@ static int process_vm_rw_pages(struct task_struct *task,
int ret; int ret;
ssize_t bytes_to_copy; ssize_t bytes_to_copy;
ssize_t rc = 0; ssize_t rc = 0;
const struct iovec *iov = lvec + *lvec_current; const struct iovec *iov = *iovp;
*bytes_copied = 0; *bytes_copied = 0;
...@@ -149,6 +149,7 @@ static int process_vm_rw_pages(struct task_struct *task, ...@@ -149,6 +149,7 @@ static int process_vm_rw_pages(struct task_struct *task,
put_page(process_pages[j]); put_page(process_pages[j]);
} }
*iovp = iov;
return rc; return rc;
} }
...@@ -192,6 +193,7 @@ static int process_vm_rw_single_vec(unsigned long addr, ...@@ -192,6 +193,7 @@ static int process_vm_rw_single_vec(unsigned long addr,
unsigned long nr_pages_to_copy; unsigned long nr_pages_to_copy;
unsigned long max_pages_per_loop = PVM_MAX_KMALLOC_PAGES unsigned long max_pages_per_loop = PVM_MAX_KMALLOC_PAGES
/ sizeof(struct pages *); / sizeof(struct pages *);
const struct iovec *iov = lvec + *lvec_current;
*bytes_copied = 0; *bytes_copied = 0;
...@@ -206,7 +208,7 @@ static int process_vm_rw_single_vec(unsigned long addr, ...@@ -206,7 +208,7 @@ static int process_vm_rw_single_vec(unsigned long addr,
rc = process_vm_rw_pages(task, mm, process_pages, pa, rc = process_vm_rw_pages(task, mm, process_pages, pa,
start_offset, len, start_offset, len,
lvec, lvec_cnt, &iov, lvec_cnt,
lvec_current, lvec_offset, lvec_current, lvec_offset,
vm_write, nr_pages_to_copy, vm_write, nr_pages_to_copy,
&bytes_copied_loop); &bytes_copied_loop);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment