From: Hsiang Kao Date: Sat, 23 Sep 2017 18:45:42 +0000 (+0800) Subject: f2fs: allow readpages with NULL file pointer X-Git-Tag: v4.15-rc1~83^2~69 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=71cb4afff80cee2b0f0dfda32f55e4e8d4f1153d;p=linux.git f2fs: allow readpages with NULL file pointer 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 Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 36b535207c88..9b68fb7eb5f1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -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);