aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-26 20:30:57 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 21:10:04 -0400
commit132ea2479f77dd598f11a77bdfebbd23d244ce6f (patch)
tree3c70e6a7c0467ddf51ee196701c2dad55a0d0d02 /mm/readahead.c
parent611443783ada3464c44e9168f6b7de2cb3fed39a (diff)
switch readahead(2) to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index ea8f8fa21649..1011111e2bf4 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -580,9 +580,10 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
580{ 580{
581 ssize_t ret; 581 ssize_t ret;
582 struct file *file; 582 struct file *file;
583 int fput_needed;
583 584
584 ret = -EBADF; 585 ret = -EBADF;
585 file = fget(fd); 586 file = fget_light(fd, &fput_needed);
586 if (file) { 587 if (file) {
587 if (file->f_mode & FMODE_READ) { 588 if (file->f_mode & FMODE_READ) {
588 struct address_space *mapping = file->f_mapping; 589 struct address_space *mapping = file->f_mapping;
@@ -591,7 +592,7 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
591 unsigned long len = end - start + 1; 592 unsigned long len = end - start + 1;
592 ret = do_readahead(mapping, file, start, len); 593 ret = do_readahead(mapping, file, start, len);
593 } 594 }
594 fput(file); 595 fput_light(file, fput_needed);
595 } 596 }
596 return ret; 597 return ret;
597} 598}