diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-27 14:48:26 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:25 -0400 |
commit | cb0942b81249798e15c3f04eee2946ef543e8115 (patch) | |
tree | 7d494c580a847342577661782c5173f76178aa81 /mm | |
parent | cecb46f194460d23cacf3b13593f9f5a4f7a0fed (diff) |
make get_file() return its argument
simplifies a bunch of callers...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/fremap.c | 3 | ||||
-rw-r--r-- | mm/mmap.c | 3 | ||||
-rw-r--r-- | mm/nommu.c | 6 |
3 files changed, 4 insertions, 8 deletions
diff --git a/mm/fremap.c b/mm/fremap.c index 9ed4fd432467..048659c0c03d 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -195,10 +195,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
195 | */ | 195 | */ |
196 | if (mapping_cap_account_dirty(mapping)) { | 196 | if (mapping_cap_account_dirty(mapping)) { |
197 | unsigned long addr; | 197 | unsigned long addr; |
198 | struct file *file = vma->vm_file; | 198 | struct file *file = get_file(vma->vm_file); |
199 | 199 | ||
200 | flags &= MAP_NONBLOCK; | 200 | flags &= MAP_NONBLOCK; |
201 | get_file(file); | ||
202 | addr = mmap_region(file, start, size, | 201 | addr = mmap_region(file, start, size, |
203 | flags, vma->vm_flags, pgoff); | 202 | flags, vma->vm_flags, pgoff); |
204 | fput(file); | 203 | fput(file); |
@@ -1301,8 +1301,7 @@ munmap_back: | |||
1301 | goto free_vma; | 1301 | goto free_vma; |
1302 | correct_wcount = 1; | 1302 | correct_wcount = 1; |
1303 | } | 1303 | } |
1304 | vma->vm_file = file; | 1304 | vma->vm_file = get_file(file); |
1305 | get_file(file); | ||
1306 | error = file->f_op->mmap(file, vma); | 1305 | error = file->f_op->mmap(file, vma); |
1307 | if (error) | 1306 | if (error) |
1308 | goto unmap_and_free_vma; | 1307 | goto unmap_and_free_vma; |
diff --git a/mm/nommu.c b/mm/nommu.c index d4b0c10872de..dee2ff89fd58 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1282,10 +1282,8 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
1282 | vma->vm_pgoff = pgoff; | 1282 | vma->vm_pgoff = pgoff; |
1283 | 1283 | ||
1284 | if (file) { | 1284 | if (file) { |
1285 | region->vm_file = file; | 1285 | region->vm_file = get_file(file); |
1286 | get_file(file); | 1286 | vma->vm_file = get_file(file); |
1287 | vma->vm_file = file; | ||
1288 | get_file(file); | ||
1289 | if (vm_flags & VM_EXECUTABLE) { | 1287 | if (vm_flags & VM_EXECUTABLE) { |
1290 | added_exe_file_vma(current->mm); | 1288 | added_exe_file_vma(current->mm); |
1291 | vma->vm_mm = current->mm; | 1289 | vma->vm_mm = current->mm; |