diff options
author | Stephen Wilson <wilsons@start.ca> | 2011-03-13 15:49:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-23 16:36:57 -0400 |
commit | 5ddd36b9c59887c6416e21daf984fbdd9b1818df (patch) | |
tree | 1cc7ce9a671f4c49dc594e1f5d1fc8b596e77b5f /mm/memory.c | |
parent | 206cb636576b969e9b471cdedeaea7752e6acb33 (diff) | |
download | linux-5ddd36b9c59887c6416e21daf984fbdd9b1818df.tar.gz linux-5ddd36b9c59887c6416e21daf984fbdd9b1818df.tar.bz2 linux-5ddd36b9c59887c6416e21daf984fbdd9b1818df.zip |
mm: implement access_remote_vm
Provide an alternative to access_process_vm that allows the caller to obtain a
reference to the supplied mm_struct.
Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 820b4c4810f0..468f5076754c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3711,6 +3711,22 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, return buf - old_buf; } +/** + * @access_remote_vm - access another process' address space + * @mm: the mm_struct of the target address space + * @addr: start address to access + * @buf: source or destination buffer + * @len: number of bytes to transfer + * @write: whether the access is a write + * + * The caller must hold a reference on @mm. + */ +int access_remote_vm(struct mm_struct *mm, unsigned long addr, + void *buf, int len, int write) +{ + return __access_remote_vm(NULL, mm, addr, buf, len, write); +} + /* * Access another process' address space. * Source/target buffer must be kernel space, |