fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend
Subsystems (2)
PATCH 1/1 fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend
From: Lei Chen <[email protected]>
iomap_add_to_ioend append page on wpc->ioend->io_bio. If io_bio is full, iomap_chain_bio will allocate a new bio. So when bio_add_page is called, pages is guaranteed to be appended into wpc->ioend->io_bio. So we do not need to check if page can be merged. Thus it's a faster way to directly call __bio_add_page.
--- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iomap/buffered-io.c +1 -1
@@ -1310,7 +1310,7 @@ static void iomap_writepage_end_bio(struct bio *bio) wpc->ioend->io_bio =iomap_chain_bio (wpc->ioend->io_bio); } -bio_add_page (wpc->ioend->io_bio, page, len, poff); +__bio_add_page (wpc->ioend->io_bio, page, len, poff); } wpc->ioend->io_size += len;
Signature · 1 line
1.8.3.1
Quoted 7 lines · On Mon, Nov 30, 2020 at 03:28:51PM +0800, [email protected] wrote:
From: Lei Chen <[email protected]>
iomap_add_to_ioendappend page onwpc->ioend->io_bio. Ifio_biois full,iomap_chain_biowill allocate a new bio. So whenbio_add_pageis called, pages is guaranteed to be appended intowpc->ioend->io_bio. So we do not need to check if page can be merged. Thus it's a faster way to directly call__bio_add_page.
How much faster?
--D
Quoted 21 lines
Signed-off-by Lei Chen <[email protected]>--- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/iomap/buffered-io.c +1
-1@@ -1310,7 +1310,7 @@ static void iomap_writepage_end_bio(struct bio *bio) wpc->ioend->io_bio =iomap_chain_bio (wpc->ioend->io_bio); } -bio_add_page (wpc->ioend->io_bio, page, len, poff); +__bio_add_page (wpc->ioend->io_bio, page, len, poff); } wpc->ioend->io_size += len;Signature · 1 line
1.8.3.1