diff mbox series

[1/7] mpage: stop using bdev_{read,write}_page

Message ID 20230125133436.447864-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/7] mpage: stop using bdev_{read,write}_page | expand

Commit Message

Christoph Hellwig Jan. 25, 2023, 1:34 p.m. UTC
These are micro-optimizations for synchronous I/O, which do not matter
compared to all the other inefficiencies in the legacy buffer_head
based mpage code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/mpage.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Dan Williams Jan. 25, 2023, 5:58 p.m. UTC | #1
Christoph Hellwig wrote:
> These are micro-optimizations for synchronous I/O, which do not matter
> compared to all the other inefficiencies in the legacy buffer_head
> based mpage code.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/mpage.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/fs/mpage.c b/fs/mpage.c
> index 0f8ae954a57903..124550cfac4a70 100644
> --- a/fs/mpage.c
> +++ b/fs/mpage.c
> @@ -269,11 +269,6 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
>  
>  alloc_new:
>  	if (args->bio == NULL) {
> -		if (first_hole == blocks_per_page) {
> -			if (!bdev_read_page(bdev, blocks[0] << (blkbits - 9),
> -								&folio->page))
> -				goto out;
> -		}
>  		args->bio = bio_alloc(bdev, bio_max_segs(args->nr_pages), opf,
>  				      gfp);
>  		if (args->bio == NULL)
> @@ -579,11 +574,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
>  
>  alloc_new:
>  	if (bio == NULL) {
> -		if (first_unmapped == blocks_per_page) {
> -			if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9),
> -								page, wbc))
> -				goto out;
> -		}
>  		bio = bio_alloc(bdev, BIO_MAX_VECS,
>  				REQ_OP_WRITE | wbc_to_write_flags(wbc),
>  				GFP_NOFS);
> -- 
> 2.39.0
> 

Makes sense,

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
diff mbox series

Patch

diff --git a/fs/mpage.c b/fs/mpage.c
index 0f8ae954a57903..124550cfac4a70 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -269,11 +269,6 @@  static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 
 alloc_new:
 	if (args->bio == NULL) {
-		if (first_hole == blocks_per_page) {
-			if (!bdev_read_page(bdev, blocks[0] << (blkbits - 9),
-								&folio->page))
-				goto out;
-		}
 		args->bio = bio_alloc(bdev, bio_max_segs(args->nr_pages), opf,
 				      gfp);
 		if (args->bio == NULL)
@@ -579,11 +574,6 @@  static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
 
 alloc_new:
 	if (bio == NULL) {
-		if (first_unmapped == blocks_per_page) {
-			if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9),
-								page, wbc))
-				goto out;
-		}
 		bio = bio_alloc(bdev, BIO_MAX_VECS,
 				REQ_OP_WRITE | wbc_to_write_flags(wbc),
 				GFP_NOFS);