public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER)
@ 2020-12-23  4:31 sh
  2020-12-23  5:38 ` Hui Su
  2020-12-23  8:33 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: sh @ 2020-12-23  4:31 UTC (permalink / raw)
  To: Jens Axboe, linux-block, linux-kernel; +Cc: sh_def, songmuchun

remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
of traversal bvec.

Signed-off-by: sh <sh_def@163.com>
---
 block/blk-merge.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 808768f6b174..aa113cbc0f35 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -494,15 +494,15 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio,
 			 * to bio
 			 */
 			if (new_bio &&
-			    __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg))
-				goto next_bvec;
+			    __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg)) {
+				new_bio = false;
+				continue;
+			}
 
 			if (bvec.bv_offset + bvec.bv_len <= PAGE_SIZE)
 				nsegs += __blk_bvec_map_sg(bvec, sglist, sg);
 			else
 				nsegs += blk_bvec_map_sg(q, &bvec, sglist, sg);
- next_bvec:
-			new_bio = false;
 		}
 		if (likely(bio->bi_iter.bi_size)) {
 			bvprv = bvec;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER)
  2020-12-23  4:31 [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER) sh
@ 2020-12-23  5:38 ` Hui Su
  2020-12-23  8:33 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Hui Su @ 2020-12-23  5:38 UTC (permalink / raw)
  To: Jens Axboe, linux-block, linux-kernel; +Cc: sh_def, songmuchun

Hi, all:

Please ignore this change, i will resend a patch V2 later.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER)
  2020-12-23  4:31 [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER) sh
  2020-12-23  5:38 ` Hui Su
@ 2020-12-23  8:33 ` Christoph Hellwig
  2020-12-23  9:24   ` Hui Su
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-12-23  8:33 UTC (permalink / raw)
  To: sh; +Cc: Jens Axboe, linux-block, linux-kernel, songmuchun

On Wed, Dec 23, 2020 at 12:31:58PM +0800, sh wrote:
> remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
> of traversal bvec.

What makes you believe that this simplifies anything?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER)
  2020-12-23  8:33 ` Christoph Hellwig
@ 2020-12-23  9:24   ` Hui Su
  0 siblings, 0 replies; 4+ messages in thread
From: Hui Su @ 2020-12-23  9:24 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-block, linux-kernel, songmuchun, sh_def

On Wed, Dec 23, 2020 at 08:33:07AM +0000, Christoph Hellwig wrote:
> On Wed, Dec 23, 2020 at 12:31:58PM +0800, sh wrote:
> > remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
> > of traversal bvec.
> 
> What makes you believe that this simplifies anything?

1. this change remove the jump lable, so we do not need goto.
2. we do not need to assign flase to new_bio in the
bio_for_each_bvec, we only need to assign false to new_bio at first.

And I have resend a PATCH V2, this change have some format problem.

Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-23 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-23  4:31 [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER) sh
2020-12-23  5:38 ` Hui Su
2020-12-23  8:33 ` Christoph Hellwig
2020-12-23  9:24   ` Hui Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox