projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'mm-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git]
/
mm
/
memory.c
diff --git
a/mm/memory.c
b/mm/memory.c
index
fc1987d
..
e18c57b
100644
(file)
--- a/
mm/memory.c
+++ b/
mm/memory.c
@@
-3869,10
+3869,11
@@
EXPORT_SYMBOL_GPL(generic_access_phys);
* given task for page fault accounting.
*/
static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
* given task for page fault accounting.
*/
static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
- unsigned long addr, void *buf, int len,
int write
)
+ unsigned long addr, void *buf, int len,
unsigned int gup_flags
)
{
struct vm_area_struct *vma;
void *old_buf = buf;
{
struct vm_area_struct *vma;
void *old_buf = buf;
+ int write = gup_flags & FOLL_WRITE;
down_read(&mm->mmap_sem);
/* ignore errors, just check how much was successfully transferred */
down_read(&mm->mmap_sem);
/* ignore errors, just check how much was successfully transferred */
@@
-3882,7
+3883,7
@@
static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
struct page *page = NULL;
ret = get_user_pages_remote(tsk, mm, addr, 1,
struct page *page = NULL;
ret = get_user_pages_remote(tsk, mm, addr, 1,
-
write, 1
, &page, &vma);
+
gup_flags
, &page, &vma);
if (ret <= 0) {
#ifndef CONFIG_HAVE_IOREMAP_PROT
break;
if (ret <= 0) {
#ifndef CONFIG_HAVE_IOREMAP_PROT
break;
@@
-3934,14
+3935,14
@@
static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
* @addr: start address to access
* @buf: source or destination buffer
* @len: number of bytes to transfer
* @addr: start address to access
* @buf: source or destination buffer
* @len: number of bytes to transfer
- * @
write: whether the access is a write
+ * @
gup_flags: flags modifying lookup behaviour
*
* The caller must hold a reference on @mm.
*/
int access_remote_vm(struct mm_struct *mm, unsigned long addr,
*
* 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
)
+ void *buf, int len,
unsigned int gup_flags
)
{
{
- return __access_remote_vm(NULL, mm, addr, buf, len,
write
);
+ return __access_remote_vm(NULL, mm, addr, buf, len,
gup_flags
);
}
/*
}
/*
@@
-3950,7
+3951,7
@@
int access_remote_vm(struct mm_struct *mm, unsigned long addr,
* Do not walk the page table directly, use get_user_pages
*/
int access_process_vm(struct task_struct *tsk, unsigned long addr,
* Do not walk the page table directly, use get_user_pages
*/
int access_process_vm(struct task_struct *tsk, unsigned long addr,
- void *buf, int len,
int write
)
+ void *buf, int len,
unsigned int gup_flags
)
{
struct mm_struct *mm;
int ret;
{
struct mm_struct *mm;
int ret;
@@
-3959,7
+3960,8
@@
int access_process_vm(struct task_struct *tsk, unsigned long addr,
if (!mm)
return 0;
if (!mm)
return 0;
- ret = __access_remote_vm(tsk, mm, addr, buf, len, write);
+ ret = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags);
+
mmput(mm);
return ret;
mmput(mm);
return ret;