diff mbox series

[v2,5/5] xfs: Pass a page to xfs_finish_page_writeback

Message ID 20190821003039.12555-6-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series iomap & xfs support for large pages | expand

Commit Message

Matthew Wilcox Aug. 21, 2019, 12:30 a.m. UTC
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

The only part of the bvec we were accessing was the bv_page, so just
pass that instead of the whole bvec.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/xfs/xfs_aops.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Darrick J. Wong Sept. 18, 2019, 9:32 p.m. UTC | #1
On Tue, Aug 20, 2019 at 05:30:39PM -0700, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> 
> The only part of the bvec we were accessing was the bv_page, so just
> pass that instead of the whole bvec.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Seems fine but same caveats about tree churn as the previous patch.

--D

> ---
>  fs/xfs/xfs_aops.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 1a26e9ca626b..edcb4797fcc2 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -58,21 +58,21 @@ xfs_find_daxdev_for_inode(
>  static void
>  xfs_finish_page_writeback(
>  	struct inode		*inode,
> -	struct bio_vec	*bvec,
> +	struct page		*page,
>  	int			error)
>  {
> -	struct iomap_page	*iop = to_iomap_page(bvec->bv_page);
> +	struct iomap_page	*iop = to_iomap_page(page);
>  
>  	if (error) {
> -		SetPageError(bvec->bv_page);
> +		SetPageError(page);
>  		mapping_set_error(inode->i_mapping, -EIO);
>  	}
>  
> -	ASSERT(iop || i_blocks_per_page(inode, bvec->bv_page) <= 1);
> +	ASSERT(iop || i_blocks_per_page(inode, page) <= 1);
>  	ASSERT(!iop || atomic_read(&iop->write_count) > 0);
>  
>  	if (!iop || atomic_dec_and_test(&iop->write_count))
> -		end_page_writeback(bvec->bv_page);
> +		end_page_writeback(page);
>  }
>  
>  /*
> @@ -106,7 +106,7 @@ xfs_destroy_ioend(
>  
>  		/* walk each page on bio, ending page IO on them */
>  		bio_for_each_segment_all(bvec, bio, iter_all)
> -			xfs_finish_page_writeback(inode, bvec, error);
> +			xfs_finish_page_writeback(inode, bvec->bv_page, error);
>  		bio_put(bio);
>  	}
>  
> -- 
> 2.23.0.rc1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 1a26e9ca626b..edcb4797fcc2 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -58,21 +58,21 @@  xfs_find_daxdev_for_inode(
 static void
 xfs_finish_page_writeback(
 	struct inode		*inode,
-	struct bio_vec	*bvec,
+	struct page		*page,
 	int			error)
 {
-	struct iomap_page	*iop = to_iomap_page(bvec->bv_page);
+	struct iomap_page	*iop = to_iomap_page(page);
 
 	if (error) {
-		SetPageError(bvec->bv_page);
+		SetPageError(page);
 		mapping_set_error(inode->i_mapping, -EIO);
 	}
 
-	ASSERT(iop || i_blocks_per_page(inode, bvec->bv_page) <= 1);
+	ASSERT(iop || i_blocks_per_page(inode, page) <= 1);
 	ASSERT(!iop || atomic_read(&iop->write_count) > 0);
 
 	if (!iop || atomic_dec_and_test(&iop->write_count))
-		end_page_writeback(bvec->bv_page);
+		end_page_writeback(page);
 }
 
 /*
@@ -106,7 +106,7 @@  xfs_destroy_ioend(
 
 		/* walk each page on bio, ending page IO on them */
 		bio_for_each_segment_all(bvec, bio, iter_all)
-			xfs_finish_page_writeback(inode, bvec, error);
+			xfs_finish_page_writeback(inode, bvec->bv_page, error);
 		bio_put(bio);
 	}