diff options
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index ea8f8fa21649..7963f2391236 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -579,19 +579,19 @@ do_readahead(struct address_space *mapping, struct file *filp, | |||
579 | SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) | 579 | SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) |
580 | { | 580 | { |
581 | ssize_t ret; | 581 | ssize_t ret; |
582 | struct file *file; | 582 | struct fd f; |
583 | 583 | ||
584 | ret = -EBADF; | 584 | ret = -EBADF; |
585 | file = fget(fd); | 585 | f = fdget(fd); |
586 | if (file) { | 586 | if (f.file) { |
587 | if (file->f_mode & FMODE_READ) { | 587 | if (f.file->f_mode & FMODE_READ) { |
588 | struct address_space *mapping = file->f_mapping; | 588 | struct address_space *mapping = f.file->f_mapping; |
589 | pgoff_t start = offset >> PAGE_CACHE_SHIFT; | 589 | pgoff_t start = offset >> PAGE_CACHE_SHIFT; |
590 | pgoff_t end = (offset + count - 1) >> PAGE_CACHE_SHIFT; | 590 | pgoff_t end = (offset + count - 1) >> PAGE_CACHE_SHIFT; |
591 | unsigned long len = end - start + 1; | 591 | unsigned long len = end - start + 1; |
592 | ret = do_readahead(mapping, file, start, len); | 592 | ret = do_readahead(mapping, f.file, start, len); |
593 | } | 593 | } |
594 | fput(file); | 594 | fdput(f); |
595 | } | 595 | } |
596 | return ret; | 596 | return ret; |
597 | } | 597 | } |