Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c803c9c6
Commit
c803c9c6
authored
Nov 18, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fold __get_user_pages_unlocked() into its sole remaining caller
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4fbd8d19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
26 deletions
+10
-26
mm/gup.c
mm/gup.c
+10
-26
No files found.
mm/gup.c
View file @
c803c9c6
...
...
@@ -964,30 +964,6 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
}
EXPORT_SYMBOL
(
get_user_pages_locked
);
/*
* Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows for
* tsk, mm to be specified.
*
* NOTE: here FOLL_TOUCH is not set implicitly and must be set by the
* caller if required (just like with __get_user_pages). "FOLL_GET"
* is set implicitly if "pages" is non-NULL.
*/
static
__always_inline
long
__get_user_pages_unlocked
(
struct
task_struct
*
tsk
,
struct
mm_struct
*
mm
,
unsigned
long
start
,
unsigned
long
nr_pages
,
struct
page
**
pages
,
unsigned
int
gup_flags
)
{
long
ret
;
int
locked
=
1
;
down_read
(
&
mm
->
mmap_sem
);
ret
=
__get_user_pages_locked
(
tsk
,
mm
,
start
,
nr_pages
,
pages
,
NULL
,
&
locked
,
false
,
gup_flags
);
if
(
locked
)
up_read
(
&
mm
->
mmap_sem
);
return
ret
;
}
/*
* get_user_pages_unlocked() is suitable to replace the form:
*
...
...
@@ -1006,8 +982,16 @@ static __always_inline long __get_user_pages_unlocked(struct task_struct *tsk,
long
get_user_pages_unlocked
(
unsigned
long
start
,
unsigned
long
nr_pages
,
struct
page
**
pages
,
unsigned
int
gup_flags
)
{
return
__get_user_pages_unlocked
(
current
,
current
->
mm
,
start
,
nr_pages
,
pages
,
gup_flags
|
FOLL_TOUCH
);
struct
mm_struct
*
mm
=
current
->
mm
;
int
locked
=
1
;
long
ret
;
down_read
(
&
mm
->
mmap_sem
);
ret
=
__get_user_pages_locked
(
current
,
mm
,
start
,
nr_pages
,
pages
,
NULL
,
&
locked
,
false
,
gup_flags
|
FOLL_TOUCH
);
if
(
locked
)
up_read
(
&
mm
->
mmap_sem
);
return
ret
;
}
EXPORT_SYMBOL
(
get_user_pages_unlocked
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment