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
f74ac015
Commit
f74ac015
authored
Feb 20, 2017
by
Miklos Szeredi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mm: use helper for calling f_op->mmap()
Signed-off-by:
Miklos Szeredi
<
mszeredi@redhat.com
>
parent
bb7462b6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
7 deletions
+12
-7
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
+1
-1
drivers/gpu/drm/vgem/vgem_drv.c
drivers/gpu/drm/vgem/vgem_drv.c
+1
-1
fs/coda/file.c
fs/coda/file.c
+1
-1
include/linux/fs.h
include/linux/fs.h
+5
-0
ipc/shm.c
ipc/shm.c
+1
-1
mm/mmap.c
mm/mmap.c
+1
-1
mm/nommu.c
mm/nommu.c
+2
-2
No files found.
drivers/gpu/drm/i915/i915_gem_dmabuf.c
View file @
f74ac015
...
@@ -141,7 +141,7 @@ static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *
...
@@ -141,7 +141,7 @@ static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *
if
(
!
obj
->
base
.
filp
)
if
(
!
obj
->
base
.
filp
)
return
-
ENODEV
;
return
-
ENODEV
;
ret
=
obj
->
base
.
filp
->
f_op
->
mmap
(
obj
->
base
.
filp
,
vma
);
ret
=
call_
mmap
(
obj
->
base
.
filp
,
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/vgem/vgem_drv.c
View file @
f74ac015
...
@@ -287,7 +287,7 @@ static int vgem_prime_mmap(struct drm_gem_object *obj,
...
@@ -287,7 +287,7 @@ static int vgem_prime_mmap(struct drm_gem_object *obj,
if
(
!
obj
->
filp
)
if
(
!
obj
->
filp
)
return
-
ENODEV
;
return
-
ENODEV
;
ret
=
obj
->
filp
->
f_op
->
mmap
(
obj
->
filp
,
vma
);
ret
=
call_
mmap
(
obj
->
filp
,
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
fs/coda/file.c
View file @
f74ac015
...
@@ -96,7 +96,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma)
...
@@ -96,7 +96,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma)
cfi
->
cfi_mapcount
++
;
cfi
->
cfi_mapcount
++
;
spin_unlock
(
&
cii
->
c_lock
);
spin_unlock
(
&
cii
->
c_lock
);
return
host_file
->
f_op
->
mmap
(
host_file
,
vma
);
return
call_
mmap
(
host_file
,
vma
);
}
}
int
coda_open
(
struct
inode
*
coda_inode
,
struct
file
*
coda_file
)
int
coda_open
(
struct
inode
*
coda_inode
,
struct
file
*
coda_file
)
...
...
include/linux/fs.h
View file @
f74ac015
...
@@ -1727,6 +1727,11 @@ static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio,
...
@@ -1727,6 +1727,11 @@ static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio,
return
file
->
f_op
->
write_iter
(
kio
,
iter
);
return
file
->
f_op
->
write_iter
(
kio
,
iter
);
}
}
static
inline
int
call_mmap
(
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
{
return
file
->
f_op
->
mmap
(
file
,
vma
);
}
ssize_t
rw_copy_check_uvector
(
int
type
,
const
struct
iovec
__user
*
uvector
,
ssize_t
rw_copy_check_uvector
(
int
type
,
const
struct
iovec
__user
*
uvector
,
unsigned
long
nr_segs
,
unsigned
long
fast_segs
,
unsigned
long
nr_segs
,
unsigned
long
fast_segs
,
struct
iovec
*
fast_pointer
,
struct
iovec
*
fast_pointer
,
...
...
ipc/shm.c
View file @
f74ac015
...
@@ -423,7 +423,7 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma)
...
@@ -423,7 +423,7 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
sfd
->
file
->
f_op
->
mmap
(
sfd
->
file
,
vma
);
ret
=
call_
mmap
(
sfd
->
file
,
vma
);
if
(
ret
)
{
if
(
ret
)
{
shm_close
(
vma
);
shm_close
(
vma
);
return
ret
;
return
ret
;
...
...
mm/mmap.c
View file @
f74ac015
...
@@ -1668,7 +1668,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
...
@@ -1668,7 +1668,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
* new file must not have been exposed to user-space, yet.
* new file must not have been exposed to user-space, yet.
*/
*/
vma
->
vm_file
=
get_file
(
file
);
vma
->
vm_file
=
get_file
(
file
);
error
=
file
->
f_op
->
mmap
(
file
,
vma
);
error
=
call_
mmap
(
file
,
vma
);
if
(
error
)
if
(
error
)
goto
unmap_and_free_vma
;
goto
unmap_and_free_vma
;
...
...
mm/nommu.c
View file @
f74ac015
...
@@ -1084,7 +1084,7 @@ static int do_mmap_shared_file(struct vm_area_struct *vma)
...
@@ -1084,7 +1084,7 @@ static int do_mmap_shared_file(struct vm_area_struct *vma)
{
{
int
ret
;
int
ret
;
ret
=
vma
->
vm_file
->
f_op
->
mmap
(
vma
->
vm_file
,
vma
);
ret
=
call_
mmap
(
vma
->
vm_file
,
vma
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
vma
->
vm_region
->
vm_top
=
vma
->
vm_region
->
vm_end
;
vma
->
vm_region
->
vm_top
=
vma
->
vm_region
->
vm_end
;
return
0
;
return
0
;
...
@@ -1115,7 +1115,7 @@ static int do_mmap_private(struct vm_area_struct *vma,
...
@@ -1115,7 +1115,7 @@ static int do_mmap_private(struct vm_area_struct *vma,
* - VM_MAYSHARE will be set if it may attempt to share
* - VM_MAYSHARE will be set if it may attempt to share
*/
*/
if
(
capabilities
&
NOMMU_MAP_DIRECT
)
{
if
(
capabilities
&
NOMMU_MAP_DIRECT
)
{
ret
=
vma
->
vm_file
->
f_op
->
mmap
(
vma
->
vm_file
,
vma
);
ret
=
call_
mmap
(
vma
->
vm_file
,
vma
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
/* shouldn't return success if we're not sharing */
/* shouldn't return success if we're not sharing */
BUG_ON
(
!
(
vma
->
vm_flags
&
VM_MAYSHARE
));
BUG_ON
(
!
(
vma
->
vm_flags
&
VM_MAYSHARE
));
...
...
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