Skip to content

Commit

Permalink
switch readahead(2) to fget_light()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 6114437 commit 132ea24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,10 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
{
ssize_t ret;
struct file *file;
int fput_needed;

ret = -EBADF;
file = fget(fd);
file = fget_light(fd, &fput_needed);
if (file) {
if (file->f_mode & FMODE_READ) {
struct address_space *mapping = file->f_mapping;
Expand All @@ -591,7 +592,7 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
unsigned long len = end - start + 1;
ret = do_readahead(mapping, file, start, len);
}
fput(file);
fput_light(file, fput_needed);
}
return ret;
}
Expand Down

0 comments on commit 132ea24

Please sign in to comment.