提交 132ea247 编写于 作者: A Al Viro

switch readahead(2) to fget_light()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 61144378
......@@ -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;
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册