mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-15 02:33:55 +00:00
switch readahead(2) to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
611443783a
commit
132ea2479f
1 changed files with 3 additions and 2 deletions
|
@ -580,9 +580,10 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
|
int fput_needed;
|
||||||
|
|
||||||
ret = -EBADF;
|
ret = -EBADF;
|
||||||
file = fget(fd);
|
file = fget_light(fd, &fput_needed);
|
||||||
if (file) {
|
if (file) {
|
||||||
if (file->f_mode & FMODE_READ) {
|
if (file->f_mode & FMODE_READ) {
|
||||||
struct address_space *mapping = file->f_mapping;
|
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;
|
unsigned long len = end - start + 1;
|
||||||
ret = do_readahead(mapping, file, start, len);
|
ret = do_readahead(mapping, file, start, len);
|
||||||
}
|
}
|
||||||
fput(file);
|
fput_light(file, fput_needed);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue