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
dc982501
Commit
dc982501
authored
May 30, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kill do_mmap() completely
just pull into vm_mmap() Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e3fc629d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
22 deletions
+10
-22
mm/mmap.c
mm/mmap.c
+5
-11
mm/nommu.c
mm/nommu.c
+5
-11
No files found.
mm/mmap.c
View file @
dc982501
...
@@ -1102,28 +1102,22 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
...
@@ -1102,28 +1102,22 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
return
mmap_region
(
file
,
addr
,
len
,
flags
,
vm_flags
,
pgoff
);
return
mmap_region
(
file
,
addr
,
len
,
flags
,
vm_flags
,
pgoff
);
}
}
static
unsigned
long
do
_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
vm
_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flag
,
unsigned
long
offset
)
unsigned
long
flag
,
unsigned
long
offset
)
{
{
unsigned
long
ret
;
struct
mm_struct
*
mm
=
current
->
mm
;
if
(
unlikely
(
offset
+
PAGE_ALIGN
(
len
)
<
offset
))
if
(
unlikely
(
offset
+
PAGE_ALIGN
(
len
)
<
offset
))
return
-
EINVAL
;
return
-
EINVAL
;
if
(
unlikely
(
offset
&
~
PAGE_MASK
))
if
(
unlikely
(
offset
&
~
PAGE_MASK
))
return
-
EINVAL
;
return
-
EINVAL
;
return
do_mmap_pgoff
(
file
,
addr
,
len
,
prot
,
flag
,
offset
>>
PAGE_SHIFT
);
}
unsigned
long
vm_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flag
,
unsigned
long
offset
)
{
unsigned
long
ret
;
struct
mm_struct
*
mm
=
current
->
mm
;
ret
=
security_mmap_file
(
file
,
prot
,
flag
);
ret
=
security_mmap_file
(
file
,
prot
,
flag
);
if
(
!
ret
)
{
if
(
!
ret
)
{
down_write
(
&
mm
->
mmap_sem
);
down_write
(
&
mm
->
mmap_sem
);
ret
=
do_mmap
(
file
,
addr
,
len
,
prot
,
flag
,
offset
);
ret
=
do_mmap
_pgoff
(
file
,
addr
,
len
,
prot
,
flag
,
offset
>>
PAGE_SHIFT
);
up_write
(
&
mm
->
mmap_sem
);
up_write
(
&
mm
->
mmap_sem
);
}
}
return
ret
;
return
ret
;
...
...
mm/nommu.c
View file @
dc982501
...
@@ -1470,28 +1470,22 @@ unsigned long do_mmap_pgoff(struct file *file,
...
@@ -1470,28 +1470,22 @@ unsigned long do_mmap_pgoff(struct file *file,
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
static
unsigned
long
do
_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
vm
_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flag
,
unsigned
long
offset
)
unsigned
long
flag
,
unsigned
long
offset
)
{
{
unsigned
long
ret
;
struct
mm_struct
*
mm
=
current
->
mm
;
if
(
unlikely
(
offset
+
PAGE_ALIGN
(
len
)
<
offset
))
if
(
unlikely
(
offset
+
PAGE_ALIGN
(
len
)
<
offset
))
return
-
EINVAL
;
return
-
EINVAL
;
if
(
unlikely
(
offset
&
~
PAGE_MASK
))
if
(
unlikely
(
offset
&
~
PAGE_MASK
))
return
-
EINVAL
;
return
-
EINVAL
;
return
do_mmap_pgoff
(
file
,
addr
,
len
,
prot
,
flag
,
offset
>>
PAGE_SHIFT
);
}
unsigned
long
vm_mmap
(
struct
file
*
file
,
unsigned
long
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flag
,
unsigned
long
offset
)
{
unsigned
long
ret
;
struct
mm_struct
*
mm
=
current
->
mm
;
ret
=
security_mmap_file
(
file
,
prot
,
flag
);
ret
=
security_mmap_file
(
file
,
prot
,
flag
);
if
(
!
ret
)
{
if
(
!
ret
)
{
down_write
(
&
mm
->
mmap_sem
);
down_write
(
&
mm
->
mmap_sem
);
ret
=
do_mmap
(
file
,
addr
,
len
,
prot
,
flag
,
offset
);
ret
=
do_mmap
_pgoff
(
file
,
addr
,
len
,
prot
,
flag
,
offset
>>
PAGE_SHIFT
);
up_write
(
&
mm
->
mmap_sem
);
up_write
(
&
mm
->
mmap_sem
);
}
}
return
ret
;
return
ret
;
...
...
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