Skip to content

Commit e716712

Browse files
author
Al Viro
committed
__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: Al Viro <viro@zeniv.linux.org.uk>
1 parent 14cb138 commit e716712

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mm/gup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
848848
unsigned long nr_pages,
849849
struct page **pages,
850850
struct vm_area_struct **vmas,
851-
int *locked, bool notify_drop,
851+
int *locked,
852852
unsigned int flags)
853853
{
854854
long ret, pages_done;
@@ -922,7 +922,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
922922
pages++;
923923
start += PAGE_SIZE;
924924
}
925-
if (notify_drop && lock_dropped && *locked) {
925+
if (lock_dropped && *locked) {
926926
/*
927927
* We must let the caller know we temporarily dropped the lock
928928
* 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,
959959
int *locked)
960960
{
961961
return __get_user_pages_locked(current, current->mm, start, nr_pages,
962-
pages, NULL, locked, true,
962+
pages, NULL, locked,
963963
gup_flags | FOLL_TOUCH);
964964
}
965965
EXPORT_SYMBOL(get_user_pages_locked);
@@ -988,7 +988,7 @@ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
988988

989989
down_read(&mm->mmap_sem);
990990
ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL,
991-
&locked, true, gup_flags | FOLL_TOUCH);
991+
&locked, gup_flags | FOLL_TOUCH);
992992
if (locked)
993993
up_read(&mm->mmap_sem);
994994
return ret;
@@ -1057,7 +1057,7 @@ long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
10571057
struct vm_area_struct **vmas, int *locked)
10581058
{
10591059
return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas,
1060-
locked, true,
1060+
locked,
10611061
gup_flags | FOLL_TOUCH | FOLL_REMOTE);
10621062
}
10631063
EXPORT_SYMBOL(get_user_pages_remote);
@@ -1074,7 +1074,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages,
10741074
struct vm_area_struct **vmas)
10751075
{
10761076
return __get_user_pages_locked(current, current->mm, start, nr_pages,
1077-
pages, vmas, NULL, false,
1077+
pages, vmas, NULL,
10781078
gup_flags | FOLL_TOUCH);
10791079
}
10801080
EXPORT_SYMBOL(get_user_pages);

0 commit comments

Comments
 (0)