Skip to content

Commit

Permalink
switch fadvise(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 d6483b7 commit 6114437
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
*/
SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
{
struct file *file = fget(fd);
int fput_needed;
struct file *file = fget_light(fd, &fput_needed);
struct address_space *mapping;
struct backing_dev_info *bdi;
loff_t endbyte; /* inclusive */
Expand Down Expand Up @@ -128,7 +129,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
ret = -EINVAL;
}
out:
fput(file);
fput_light(file, fput_needed);
return ret;
}
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
Expand Down

0 comments on commit 6114437

Please sign in to comment.