Commit 61144378 authored by Al Viro's avatar Al Viro

switch fadvise(2) to fget_light()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent d6483b7a
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
*/ */
SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) 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 address_space *mapping;
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
loff_t endbyte; /* inclusive */ loff_t endbyte; /* inclusive */
...@@ -128,7 +129,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) ...@@ -128,7 +129,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
ret = -EINVAL; ret = -EINVAL;
} }
out: out:
fput(file); fput_light(file, fput_needed);
return ret; return ret;
} }
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment