diff mbox series

[10/23] ocfs2: Convert ocfs2_write_failure() to use a folio

Message ID 20241205171653.3179945-11-willy@infradead.org (mailing list archive)
State New
Headers show
Series Convert ocfs2 to use folios | expand

Commit Message

Matthew Wilcox (Oracle) Dec. 5, 2024, 5:16 p.m. UTC
From: Mark Tinguely <mark.tinguely@oracle.com>

Remove the folio->page conversion and just use the folio.

Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/ocfs2/aops.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Joseph Qi Dec. 14, 2024, 2:16 p.m. UTC | #1
On 2024/12/6 01:16, Matthew Wilcox (Oracle) wrote:
> From: Mark Tinguely <mark.tinguely@oracle.com>
> 
> Remove the folio->page conversion and just use the folio.
> 
> Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Looks good.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  fs/ocfs2/aops.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
> index afc20ab52b3e..8dda080743b7 100644
> --- a/fs/ocfs2/aops.c
> +++ b/fs/ocfs2/aops.c
> @@ -930,20 +930,19 @@ static void ocfs2_write_failure(struct inode *inode,
>  	int i;
>  	unsigned from = user_pos & (PAGE_SIZE - 1),
>  		to = user_pos + user_len;
> -	struct page *tmppage;
>  
>  	if (wc->w_target_folio)
>  		ocfs2_zero_new_buffers(wc->w_target_folio, from, to);
>  
>  	for (i = 0; i < wc->w_num_folios; i++) {
> -		tmppage = &wc->w_folios[i]->page;
> +		struct folio *folio = wc->w_folios[i];
>  
> -		if (tmppage && page_has_buffers(tmppage)) {
> +		if (folio && folio_buffers(folio)) {
>  			if (ocfs2_should_order_data(inode))
>  				ocfs2_jbd2_inode_add_write(wc->w_handle, inode,
>  							   user_pos, user_len);
>  
> -			block_commit_write(tmppage, from, to);
> +			block_commit_write(&folio->page, from, to);
>  		}
>  	}
>  }
diff mbox series

Patch

diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index afc20ab52b3e..8dda080743b7 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -930,20 +930,19 @@  static void ocfs2_write_failure(struct inode *inode,
 	int i;
 	unsigned from = user_pos & (PAGE_SIZE - 1),
 		to = user_pos + user_len;
-	struct page *tmppage;
 
 	if (wc->w_target_folio)
 		ocfs2_zero_new_buffers(wc->w_target_folio, from, to);
 
 	for (i = 0; i < wc->w_num_folios; i++) {
-		tmppage = &wc->w_folios[i]->page;
+		struct folio *folio = wc->w_folios[i];
 
-		if (tmppage && page_has_buffers(tmppage)) {
+		if (folio && folio_buffers(folio)) {
 			if (ocfs2_should_order_data(inode))
 				ocfs2_jbd2_inode_add_write(wc->w_handle, inode,
 							   user_pos, user_len);
 
-			block_commit_write(tmppage, from, to);
+			block_commit_write(&folio->page, from, to);
 		}
 	}
 }