Re: [Cluster-devel] [PATCH v9 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-03-23 Thread Namjae Jeon
> diff --git a/drivers/staging/exfat/exfat_super.c
> b/drivers/staging/exfat/exfat_super.c
> index b81d2a87b82e..96aad9b16d31 100644
> --- a/drivers/staging/exfat/exfat_super.c
> +++ b/drivers/staging/exfat/exfat_super.c
Maybe, You should change fs/exfat instead of staging/exfat that is
gone from -next ?

> @@ -3002,10 +3002,9 @@ static int exfat_readpage(struct file *file, struct
> page *page)
>   return  mpage_readpage(page, exfat_get_block);
>  }
>
> -static int exfat_readpages(struct file *file, struct address_space
> *mapping,
> -struct list_head *pages, unsigned int nr_pages)
> +static void exfat_readahead(struct readahead_control *rac)
>  {
> - return  mpage_readpages(mapping, pages, nr_pages, exfat_get_block);
> + mpage_readahead(rac, exfat_get_block);
>  }
>
>  static int exfat_writepage(struct page *page, struct writeback_control
> *wbc)
> @@ -3104,7 +3103,7 @@ static sector_t _exfat_bmap(struct address_space
> *mapping, sector_t block)
>
>  static const struct address_space_operations exfat_aops = {
>   .readpage= exfat_readpage,
> - .readpages   = exfat_readpages,
> + .readahead   = exfat_readahead,
>   .writepage   = exfat_writepage,
>   .writepages  = exfat_writepages,
>   .write_begin = exfat_write_begin,




[Cluster-devel] [PATCH v9 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" 

Implement the new readahead aop and convert all callers (block_dev,
exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6,
reiserfs & udf).  The callers are all trivial except for GFS2 & OCFS2.

Signed-off-by: Matthew Wilcox (Oracle) 
Reviewed-by: Junxiao Bi  # ocfs2
Reviewed-by: Joseph Qi  # ocfs2
Reviewed-by: Dave Chinner 
Reviewed-by: John Hubbard 
Reviewed-by: Christoph Hellwig 
Reviewed-by: William Kucharski 
---
 drivers/staging/exfat/exfat_super.c |  7 +++---
 fs/block_dev.c  |  7 +++---
 fs/ext2/inode.c | 10 +++-
 fs/fat/inode.c  |  7 +++---
 fs/gfs2/aops.c  | 23 ++---
 fs/hpfs/file.c  |  7 +++---
 fs/iomap/buffered-io.c  |  2 +-
 fs/isofs/inode.c|  7 +++---
 fs/jfs/inode.c  |  7 +++---
 fs/mpage.c  | 38 +
 fs/nilfs2/inode.c   | 15 +++-
 fs/ocfs2/aops.c | 34 ++
 fs/omfs/file.c  |  7 +++---
 fs/qnx6/inode.c |  7 +++---
 fs/reiserfs/inode.c |  8 +++---
 fs/udf/inode.c  |  7 +++---
 include/linux/mpage.h   |  4 +--
 mm/migrate.c|  2 +-
 18 files changed, 73 insertions(+), 126 deletions(-)

diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index b81d2a87b82e..96aad9b16d31 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -3002,10 +3002,9 @@ static int exfat_readpage(struct file *file, struct page 
*page)
return  mpage_readpage(page, exfat_get_block);
 }
 
-static int exfat_readpages(struct file *file, struct address_space *mapping,
-  struct list_head *pages, unsigned int nr_pages)
+static void exfat_readahead(struct readahead_control *rac)
 {
-   return  mpage_readpages(mapping, pages, nr_pages, exfat_get_block);
+   mpage_readahead(rac, exfat_get_block);
 }
 
 static int exfat_writepage(struct page *page, struct writeback_control *wbc)
@@ -3104,7 +3103,7 @@ static sector_t _exfat_bmap(struct address_space 
*mapping, sector_t block)
 
 static const struct address_space_operations exfat_aops = {
.readpage= exfat_readpage,
-   .readpages   = exfat_readpages,
+   .readahead   = exfat_readahead,
.writepage   = exfat_writepage,
.writepages  = exfat_writepages,
.write_begin = exfat_write_begin,
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 69bf2fb6f7cd..2fd9c7bd61f6 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -614,10 +614,9 @@ static int blkdev_readpage(struct file * file, struct page 
* page)
return block_read_full_page(page, blkdev_get_block);
 }
 
-static int blkdev_readpages(struct file *file, struct address_space *mapping,
-   struct list_head *pages, unsigned nr_pages)
+static void blkdev_readahead(struct readahead_control *rac)
 {
-   return mpage_readpages(mapping, pages, nr_pages, blkdev_get_block);
+   mpage_readahead(rac, blkdev_get_block);
 }
 
 static int blkdev_write_begin(struct file *file, struct address_space *mapping,
@@ -2062,7 +2061,7 @@ static int blkdev_writepages(struct address_space 
*mapping,
 
 static const struct address_space_operations def_blk_aops = {
.readpage   = blkdev_readpage,
-   .readpages  = blkdev_readpages,
+   .readahead  = blkdev_readahead,
.writepage  = blkdev_writepage,
.write_begin= blkdev_write_begin,
.write_end  = blkdev_write_end,
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index c885cf7d724b..2875c0a705b5 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -877,11 +877,9 @@ static int ext2_readpage(struct file *file, struct page 
*page)
return mpage_readpage(page, ext2_get_block);
 }
 
-static int
-ext2_readpages(struct file *file, struct address_space *mapping,
-   struct list_head *pages, unsigned nr_pages)
+static void ext2_readahead(struct readahead_control *rac)
 {
-   return mpage_readpages(mapping, pages, nr_pages, ext2_get_block);
+   mpage_readahead(rac, ext2_get_block);
 }
 
 static int
@@ -967,7 +965,7 @@ ext2_dax_writepages(struct address_space *mapping, struct 
writeback_control *wbc
 
 const struct address_space_operations ext2_aops = {
.readpage   = ext2_readpage,
-   .readpages  = ext2_readpages,
+   .readahead  = ext2_readahead,
.writepage  = ext2_writepage,
.write_begin= ext2_write_begin,
.write_end  = ext2_write_end,
@@ -981,7 +979,7 @@ const struct address_space_operations ext2_aops = {
 
 const struct address_space_operations ext2_nobh_aops = {
.readpage   =