diff mbox series

[f2fs-dev,v3,1/9] f2fs: convert f2fs_submit_page_read() to use folio

Message ID 20240820145507.1372905-1-chao@kernel.org (mailing list archive)
State Accepted
Commit f5e3739942b5895b5e67d4afb5f4ead4c2f63343
Headers show
Series [f2fs-dev,v3,1/9] f2fs: convert f2fs_submit_page_read() to use folio | expand

Commit Message

Chao Yu Aug. 20, 2024, 2:54 p.m. UTC
Convert to use folio, so that we can get rid of 'page->index' to
prepare for removal of 'index' field in structure page [1].

[1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/

Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/data.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Li Zetao Aug. 21, 2024, 11:01 a.m. UTC | #1
Hi,

在 2024/8/20 22:54, Chao Yu 写道:
> Convert to use folio, so that we can get rid of 'page->index' to
> prepare for removal of 'index' field in structure page [1].
> 
> [1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/
> 
> Cc: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>   fs/f2fs/data.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 4f4e76c33611..0655fddfc4ba 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1086,7 +1086,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
>   }
>   
>   /* This can handle encryption stuffs */
> -static int f2fs_submit_page_read(struct inode *inode, struct page *page,
> +static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
>   				 block_t blkaddr, blk_opf_t op_flags,
>   				 bool for_write)
>   {
> @@ -1094,14 +1094,14 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
>   	struct bio *bio;
>   
>   	bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
> -					page->index, for_write);
> +					folio->index, for_write);
>   	if (IS_ERR(bio))
>   		return PTR_ERR(bio);
>   
>   	/* wait for GCed page writeback via META_MAPPING */
>   	f2fs_wait_on_block_writeback(inode, blkaddr);
>   
> -	if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
> +	if (!bio_add_folio(bio, folio, PAGE_SIZE, 0)) {
>   		iostat_update_and_unbind_ctx(bio);
>   		if (bio->bi_private)
>   			mempool_free(bio->bi_private, bio_post_read_ctx_pool);
> @@ -1269,7 +1269,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
>   		return page;
>   	}
>   
> -	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr,
> +	err = f2fs_submit_page_read(inode, page_folio(page), dn.data_blkaddr,
>   						op_flags, for_write);
>   	if (err)
>   		goto put_err;
> @@ -3668,8 +3668,8 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
>   			goto fail;
>   		}
>   		err = f2fs_submit_page_read(use_cow ?
> -				F2FS_I(inode)->cow_inode : inode, page,
> -				blkaddr, 0, true);
> +				F2FS_I(inode)->cow_inode : inode,
> +				page_folio(page), blkaddr, 0, true);
>   		if (err)
>   			goto fail;
>   
I have tested this patchset with fsstress and got any issue.

Reviewed-by: Li Zetao <lizetao1@huawei.com>

Thanks,
Li Zetao.
liuderong--- via Linux-f2fs-devel Aug. 30, 2024, 8:51 p.m. UTC | #2
Hello:

This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Tue, 20 Aug 2024 22:54:59 +0800 you wrote:
> Convert to use folio, so that we can get rid of 'page->index' to
> prepare for removal of 'index' field in structure page [1].
> 
> [1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/
> 
> Cc: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v3,1/9] f2fs: convert f2fs_submit_page_read() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/f5e3739942b5
  - [f2fs-dev,v3,2/9] f2fs: convert f2fs_write_begin() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/f13c7184e62e
  - [f2fs-dev,v3,3/9] f2fs: convert f2fs_write_end() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/357dd8479f8b
  - [f2fs-dev,v3,4/9] f2fs: convert f2fs_set_compressed_page() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/4713b14f107a
  - [f2fs-dev,v3,5/9] f2fs: convert f2fs_do_write_data_page() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/609c7375350a
  - [f2fs-dev,v3,6/9] f2fs: convert f2fs_write_data_page() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/75428dcd4d2e
  - [f2fs-dev,v3,7/9] f2fs: convert __write_node_page() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/62b691af1a66
  - [f2fs-dev,v3,8/9] f2fs: convert read_node_page() to use folio
    https://git.kernel.org/jaegeuk/f2fs/c/e381d92a035a
  - [f2fs-dev,v3,9/9] f2fs: get rid of page->index
    https://git.kernel.org/jaegeuk/f2fs/c/c6f1758f7a68

You are awesome, thank you!
diff mbox series

Patch

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 4f4e76c33611..0655fddfc4ba 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1086,7 +1086,7 @@  static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
 }
 
 /* This can handle encryption stuffs */
-static int f2fs_submit_page_read(struct inode *inode, struct page *page,
+static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
 				 block_t blkaddr, blk_opf_t op_flags,
 				 bool for_write)
 {
@@ -1094,14 +1094,14 @@  static int f2fs_submit_page_read(struct inode *inode, struct page *page,
 	struct bio *bio;
 
 	bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
-					page->index, for_write);
+					folio->index, for_write);
 	if (IS_ERR(bio))
 		return PTR_ERR(bio);
 
 	/* wait for GCed page writeback via META_MAPPING */
 	f2fs_wait_on_block_writeback(inode, blkaddr);
 
-	if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
+	if (!bio_add_folio(bio, folio, PAGE_SIZE, 0)) {
 		iostat_update_and_unbind_ctx(bio);
 		if (bio->bi_private)
 			mempool_free(bio->bi_private, bio_post_read_ctx_pool);
@@ -1269,7 +1269,7 @@  struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
 		return page;
 	}
 
-	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr,
+	err = f2fs_submit_page_read(inode, page_folio(page), dn.data_blkaddr,
 						op_flags, for_write);
 	if (err)
 		goto put_err;
@@ -3668,8 +3668,8 @@  static int f2fs_write_begin(struct file *file, struct address_space *mapping,
 			goto fail;
 		}
 		err = f2fs_submit_page_read(use_cow ?
-				F2FS_I(inode)->cow_inode : inode, page,
-				blkaddr, 0, true);
+				F2FS_I(inode)->cow_inode : inode,
+				page_folio(page), blkaddr, 0, true);
 		if (err)
 			goto fail;