]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
f2fs: allow readpages with NULL file pointer
authorHsiang Kao <hsiangkao@aol.com>
Sat, 23 Sep 2017 18:45:42 +0000 (02:45 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 10 Oct 2017 19:49:52 +0000 (12:49 -0700)
Keep in line with the other Linux file system implementations
since page_cache_sync_readahead supports NULL file pointer,
and thus we can readahead data by f2fs itself without file opening
(something like the btrfs behavior).

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 36b535207c88906efae946f71195781497be87f5..9b68fb7eb5f12a015378433125755247a9dba03a 100644 (file)
@@ -1334,7 +1334,7 @@ static int f2fs_read_data_pages(struct file *file,
                        struct address_space *mapping,
                        struct list_head *pages, unsigned nr_pages)
 {
-       struct inode *inode = file->f_mapping->host;
+       struct inode *inode = mapping->host;
        struct page *page = list_last_entry(pages, struct page, lru);
 
        trace_f2fs_readpages(inode, page, nr_pages);