Commit e716712f authored by Al Viro's avatar Al Viro

__get_user_pages_locked(): get rid of notify_drop argument

The only caller that doesn't pass true in it is get_user_pages() and
it passes NULL in locked.  The only place where we check it is
	if (notify_locked && lock_dropped && *locked)
and lock_dropped can become true only if we have locked != NULL.
In other words, the second part of condition will be false when
called by get_user_pages().

Just get rid of the argument and turn the condition into
	if (lock_dropped && *locked)
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 14cb138d
...@@ -848,7 +848,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk, ...@@ -848,7 +848,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
unsigned long nr_pages, unsigned long nr_pages,
struct page **pages, struct page **pages,
struct vm_area_struct **vmas, struct vm_area_struct **vmas,
int *locked, bool notify_drop, int *locked,
unsigned int flags) unsigned int flags)
{ {
long ret, pages_done; long ret, pages_done;
...@@ -922,7 +922,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk, ...@@ -922,7 +922,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
pages++; pages++;
start += PAGE_SIZE; start += PAGE_SIZE;
} }
if (notify_drop && lock_dropped && *locked) { if (lock_dropped && *locked) {
/* /*
* We must let the caller know we temporarily dropped the lock * We must let the caller know we temporarily dropped the lock
* and so the critical section protected by it was lost. * and so the critical section protected by it was lost.
...@@ -959,7 +959,7 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages, ...@@ -959,7 +959,7 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
int *locked) int *locked)
{ {
return __get_user_pages_locked(current, current->mm, start, nr_pages, return __get_user_pages_locked(current, current->mm, start, nr_pages,
pages, NULL, locked, true, pages, NULL, locked,
gup_flags | FOLL_TOUCH); gup_flags | FOLL_TOUCH);
} }
EXPORT_SYMBOL(get_user_pages_locked); EXPORT_SYMBOL(get_user_pages_locked);
...@@ -988,7 +988,7 @@ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, ...@@ -988,7 +988,7 @@ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL, ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL,
&locked, true, gup_flags | FOLL_TOUCH); &locked, gup_flags | FOLL_TOUCH);
if (locked) if (locked)
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
return ret; return ret;
...@@ -1057,7 +1057,7 @@ long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, ...@@ -1057,7 +1057,7 @@ long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
struct vm_area_struct **vmas, int *locked) struct vm_area_struct **vmas, int *locked)
{ {
return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas,
locked, true, locked,
gup_flags | FOLL_TOUCH | FOLL_REMOTE); gup_flags | FOLL_TOUCH | FOLL_REMOTE);
} }
EXPORT_SYMBOL(get_user_pages_remote); EXPORT_SYMBOL(get_user_pages_remote);
...@@ -1074,7 +1074,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages, ...@@ -1074,7 +1074,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages,
struct vm_area_struct **vmas) struct vm_area_struct **vmas)
{ {
return __get_user_pages_locked(current, current->mm, start, nr_pages, return __get_user_pages_locked(current, current->mm, start, nr_pages,
pages, vmas, NULL, false, pages, vmas, NULL,
gup_flags | FOLL_TOUCH); gup_flags | FOLL_TOUCH);
} }
EXPORT_SYMBOL(get_user_pages); EXPORT_SYMBOL(get_user_pages);
......
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