]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/readahead.c
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
[karo-tx-linux.git] / mm / readahead.c
index ea8f8fa21649d7069543e19e0e48ae38d63c175e..7963f239123689864a5bf1d9e174d595c6cf1592 100644 (file)
@@ -579,19 +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;
+       struct fd f;
 
        ret = -EBADF;
-       file = fget(fd);
-       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(file);
+               fdput(f);
        }
        return ret;
 }