@@ -964,30 +964,6 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
964
964
}
965
965
EXPORT_SYMBOL (get_user_pages_locked );
966
966
967
- /*
968
- * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows for
969
- * tsk, mm to be specified.
970
- *
971
- * NOTE: here FOLL_TOUCH is not set implicitly and must be set by the
972
- * caller if required (just like with __get_user_pages). "FOLL_GET"
973
- * is set implicitly if "pages" is non-NULL.
974
- */
975
- static __always_inline long __get_user_pages_unlocked (struct task_struct * tsk ,
976
- struct mm_struct * mm , unsigned long start ,
977
- unsigned long nr_pages , struct page * * pages ,
978
- unsigned int gup_flags )
979
- {
980
- long ret ;
981
- int locked = 1 ;
982
-
983
- down_read (& mm -> mmap_sem );
984
- ret = __get_user_pages_locked (tsk , mm , start , nr_pages , pages , NULL ,
985
- & locked , false, gup_flags );
986
- if (locked )
987
- up_read (& mm -> mmap_sem );
988
- return ret ;
989
- }
990
-
991
967
/*
992
968
* get_user_pages_unlocked() is suitable to replace the form:
993
969
*
@@ -1006,8 +982,16 @@ static __always_inline long __get_user_pages_unlocked(struct task_struct *tsk,
1006
982
long get_user_pages_unlocked (unsigned long start , unsigned long nr_pages ,
1007
983
struct page * * pages , unsigned int gup_flags )
1008
984
{
1009
- return __get_user_pages_unlocked (current , current -> mm , start , nr_pages ,
1010
- pages , gup_flags | FOLL_TOUCH );
985
+ struct mm_struct * mm = current -> mm ;
986
+ int locked = 1 ;
987
+ long ret ;
988
+
989
+ down_read (& mm -> mmap_sem );
990
+ ret = __get_user_pages_locked (current , mm , start , nr_pages , pages , NULL ,
991
+ & locked , false, gup_flags | FOLL_TOUCH );
992
+ if (locked )
993
+ up_read (& mm -> mmap_sem );
994
+ return ret ;
1011
995
}
1012
996
EXPORT_SYMBOL (get_user_pages_unlocked );
1013
997
0 commit comments