Commit d3f5ffca authored by John Hubbard's avatar John Hubbard Committed by Linus Torvalds

mm: cleanup: remove unused tsk arg from __access_remote_vm

Despite a comment that said that page fault accounting would be charged to
whatever task_struct* was passed into __access_remote_vm(), the tsk
argument was actually unused.

Making page fault accounting actually use this task struct is quite a
project, so there is no point in keeping the tsk argument.

Delete both the comment, and the argument.

[rppt@linux.ibm.com: changelog addition]

Link: https://lkml.kernel.org/r/20201026074137.4147787-1-jhubbard@nvidia.comSigned-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent be37c98d
...@@ -1716,8 +1716,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, ...@@ -1716,8 +1716,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr,
void *buf, int len, unsigned int gup_flags); void *buf, int len, unsigned int gup_flags);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
void *buf, int len, unsigned int gup_flags); void *buf, int len, unsigned int gup_flags);
extern int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, extern int __access_remote_vm(struct mm_struct *mm, unsigned long addr,
unsigned long addr, void *buf, int len, unsigned int gup_flags); void *buf, int len, unsigned int gup_flags);
long get_user_pages_remote(struct mm_struct *mm, long get_user_pages_remote(struct mm_struct *mm,
unsigned long start, unsigned long nr_pages, unsigned long start, unsigned long nr_pages,
......
...@@ -57,7 +57,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr, ...@@ -57,7 +57,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
return 0; return 0;
} }
ret = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); ret = __access_remote_vm(mm, addr, buf, len, gup_flags);
mmput(mm); mmput(mm);
return ret; return ret;
......
...@@ -4885,11 +4885,10 @@ EXPORT_SYMBOL_GPL(generic_access_phys); ...@@ -4885,11 +4885,10 @@ EXPORT_SYMBOL_GPL(generic_access_phys);
#endif #endif
/* /*
* Access another process' address space as given in mm. If non-NULL, use the * Access another process' address space as given in mm.
* given task for page fault accounting.
*/ */
int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf,
unsigned long addr, void *buf, int len, unsigned int gup_flags) int len, unsigned int gup_flags)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
void *old_buf = buf; void *old_buf = buf;
...@@ -4966,7 +4965,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, ...@@ -4966,7 +4965,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
int access_remote_vm(struct mm_struct *mm, unsigned long addr, int access_remote_vm(struct mm_struct *mm, unsigned long addr,
void *buf, int len, unsigned int gup_flags) void *buf, int len, unsigned int gup_flags)
{ {
return __access_remote_vm(NULL, mm, addr, buf, len, gup_flags); return __access_remote_vm(mm, addr, buf, len, gup_flags);
} }
/* /*
...@@ -4984,7 +4983,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, ...@@ -4984,7 +4983,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr,
if (!mm) if (!mm)
return 0; return 0;
ret = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); ret = __access_remote_vm(mm, addr, buf, len, gup_flags);
mmput(mm); mmput(mm);
......
...@@ -1675,8 +1675,8 @@ void filemap_map_pages(struct vm_fault *vmf, ...@@ -1675,8 +1675,8 @@ void filemap_map_pages(struct vm_fault *vmf,
} }
EXPORT_SYMBOL(filemap_map_pages); EXPORT_SYMBOL(filemap_map_pages);
int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf,
unsigned long addr, void *buf, int len, unsigned int gup_flags) int len, unsigned int gup_flags)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
int write = gup_flags & FOLL_WRITE; int write = gup_flags & FOLL_WRITE;
...@@ -1722,7 +1722,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, ...@@ -1722,7 +1722,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
int access_remote_vm(struct mm_struct *mm, unsigned long addr, int access_remote_vm(struct mm_struct *mm, unsigned long addr,
void *buf, int len, unsigned int gup_flags) void *buf, int len, unsigned int gup_flags)
{ {
return __access_remote_vm(NULL, mm, addr, buf, len, gup_flags); return __access_remote_vm(mm, addr, buf, len, gup_flags);
} }
/* /*
...@@ -1741,7 +1741,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in ...@@ -1741,7 +1741,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
if (!mm) if (!mm)
return 0; return 0;
len = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); len = __access_remote_vm(mm, addr, buf, len, gup_flags);
mmput(mm); mmput(mm);
return len; return len;
......
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