mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a5b470ba06
commit
2903ff019b
44 changed files with 633 additions and 763 deletions
|
|
@ -579,20 +579,19 @@ do_readahead(struct address_space *mapping, struct file *filp,
|
|||
SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
|
||||
{
|
||||
ssize_t ret;
|
||||
struct file *file;
|
||||
int fput_needed;
|
||||
struct fd f;
|
||||
|
||||
ret = -EBADF;
|
||||
file = fget_light(fd, &fput_needed);
|
||||
if (file) {
|
||||
if (file->f_mode & FMODE_READ) {
|
||||
struct address_space *mapping = file->f_mapping;
|
||||
f = fdget(fd);
|
||||
if (f.file) {
|
||||
if (f.file->f_mode & FMODE_READ) {
|
||||
struct address_space *mapping = f.file->f_mapping;
|
||||
pgoff_t start = offset >> PAGE_CACHE_SHIFT;
|
||||
pgoff_t end = (offset + count - 1) >> PAGE_CACHE_SHIFT;
|
||||
unsigned long len = end - start + 1;
|
||||
ret = do_readahead(mapping, file, start, len);
|
||||
ret = do_readahead(mapping, f.file, start, len);
|
||||
}
|
||||
fput_light(file, fput_needed);
|
||||
fdput(f);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue