Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5546358pxu; Tue, 22 Dec 2020 22:08:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAVhohUZbcYwd7O1La5raog3K1UzhsR6cU0mJVbnpQj3e2uZMSdL4TE7U+2APGl72J6lc8 X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr23054291ejb.284.1608703734595; Tue, 22 Dec 2020 22:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608703734; cv=none; d=google.com; s=arc-20160816; b=D+/Ep4MdnujD3ClatOUSBEtZjl/bqIvdqUe91B69CxLYGC/IS+iJLMB2ratG10Ccbe t3B/jIBBgH5oqY0QzebTEdGDXStwqNJ/MjqNZWakNTWMSqTXa3H2jBl/6M0ZzN652nEG MJpBm3l+3PC59Z7EGn4u7O25ysn8wouFRzziQHgYLns3CsRL5OALLhUuDFKoT+YM1uOJ rQZu+EaXa50T2QB3RZMmlg6ij9LM/jCueDzWCYrdRuVgwcOeyEPNT2ZG6XmtHPh1VpaA /DiwD14Uyik33HLAWd4v4+xBWwPnh7YpjwdI2K8UssokG1y6yvuMgWzFmtbXq7ek+gJo njNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=+qzX9e/A20Xku17b5CKfRVqXOFJkSi0RqKcf8lKRqUQ=; b=kKPjCVWKS+ky1B0ym0XIA2sPprgdTJIwwqCGahq9Zghn+qTlcTFTpuIavk7NgK3A2D moNEjQaBrF8jbPjQA5dtcdBstIlYvJr9F+NqAeYnds/9CilM3TDTX1t8K62aCU3pkSAp WzbDNJmZaJsPn+svW6Uz8UFZQRSTJEo8UisbElhRKkeF6guGDhedl6+LWzSFTpJUqmHi 6uUzqwd2kOCfEkPp+hLCgQAvLfzgvckQ5zF1HlX0Mw/w/tK9DzFh8G6QcI15n4xtSMFX 0U8gkbwAh8EsnyxRnXSW/Npg1oarPqNsJ8IQ6Ll0r3US7w9hk5qZlAA8D/txCs6hLRD1 bjdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=fc3GI7Q6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb21si12750830edb.91.2020.12.22.22.08.30; Tue, 22 Dec 2020 22:08:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=fc3GI7Q6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbgLWGHz (ORCPT + 99 others); Wed, 23 Dec 2020 01:07:55 -0500 Received: from m12-17.163.com ([220.181.12.17]:60099 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbgLWGHy (ORCPT ); Wed, 23 Dec 2020 01:07:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=+qzX9 e/A20Xku17b5CKfRVqXOFJkSi0RqKcf8lKRqUQ=; b=fc3GI7Q6/nWTAZeH/WyKI MPmX1oo105ToMnFo6lN14unoiiYy2AB4+dnGJkc7jYZp62fzQQ0voqiComssJYI6 yjqqqNu0P4PmZnOgfdyPezNZrhBm+nSaMfRR5rrvzVYDs/cdYrE1YBiOF24kcb8U OsF0H+c6SbN6Lr8Z8ofGtM= Received: from localhost (unknown [101.86.213.121]) by smtp13 (Coremail) with SMTP id EcCowACHn4s+yOJfq4JZbQ--.31614S2; Wed, 23 Dec 2020 12:31:58 +0800 (CST) Date: Wed, 23 Dec 2020 12:31:58 +0800 From: sh To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sh_def@163.com, songmuchun@bytedance.com Subject: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()linux-block@vger.kernel.org (open list:BLOCK LAYER) Message-ID: <20201223043158.GA1502002@ubuntu-A520I-AC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CM-TRANSID: EcCowACHn4s+yOJfq4JZbQ--.31614S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKw43ZF1xXw13Cw1kGFW8Xrb_yoWfCrX_CF 4Iyryxta9rAr4fu34vy3Z5Xr92krW7Xr1jy343tay7AFWSgF4rCw17AFZxX393GayfC3s8 J3WkXry3KF40qjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRR4lkDUUUUU== X-Originating-IP: [101.86.213.121] X-CM-SenderInfo: xvkbvvri6rljoofrz/xtbBQR4EX1++IOgj+gAAs0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org remove the next_bvec label in __blk_bios_map_sg(), simplify the logic of traversal bvec. Signed-off-by: sh --- 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