Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5737229pxu; Wed, 23 Dec 2020 04:20:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJDwAOQ6+w19XKf35INJ2HaUHx6SDZAPM9wwQlgbjHf2Q+BRdGqVxcd8qAL6UPDazsvinD X-Received: by 2002:a17:906:82ce:: with SMTP id a14mr24071424ejy.421.1608726010138; Wed, 23 Dec 2020 04:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608726010; cv=none; d=google.com; s=arc-20160816; b=U301FvjJJlk8utCU4puSouHWBmKkBwfdG7NwazJZ22SFNwR+zIjnNLzY/9ewKStv7X Y3P9NaLvBWQ6kB2e94b2rHRtHPny2IeDtkYw5xDTXNayHZhFpHA4Nrmvn8NX9SJIoEi/ 4fn8L7tFoslrYoYO5TFPnOPODrqRjDdwTvz5BQHRCj9I1lYQ/bsUpTHHYrG0GVSVGGkc MqhN1UN/ZilHttv67klvjGnr6aQBAskEWZpEKVfc0dRNG6pnHyOaFizJysADxfd8IDRZ mnUyBrNTAy1hmECsyujRq6LtfnAelYdETrwrshT8/XWQ8QS4CCzks5ChsplX5ZJYoJ/e dUFg== 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=FcPx2DZiZ+GuOrv1VYhC+mYz5zqBfydTQJenNzGD+AM=; b=Ehw4yedhzc3mXs4U/r98dJPHmbJCgG895Y8jdafXPn+c0Ac2xwSHjaLH+9hHf5Pxf3 I+kpoI8ibnfRyVu8v8HACRy479xcx4aqTlaU8cdPTSjlq7h5Y8YnXvbPDQ3IPEPKhAlb vpLPo47J70+OLeC611iDls+AR+P0Kiy6AryNmd4FI5ja4TuEpZdqD6szwv2MQyAuYlsX bTBAlojz7ZhAKUMvmU7k6W4Sx7KWMCu72XM6bODmuYqa8vIwvCL1JHj+MlS0a/0v/iGY SJfBRp2WAUGyMlGriG+kcMKFmwKLs/7O5WXoGdNxBVS0QT8QUt5kQj2hoP+HEfkjd3fs KtoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jZ9SR+Uo; 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 o11si12149773ejg.118.2020.12.23.04.19.48; Wed, 23 Dec 2020 04:20:10 -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=jZ9SR+Uo; 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 S1728576AbgLWMSq (ORCPT + 99 others); Wed, 23 Dec 2020 07:18:46 -0500 Received: from m12-13.163.com ([220.181.12.13]:39023 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728546AbgLWMSp (ORCPT ); Wed, 23 Dec 2020 07:18:45 -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=FcPx2 DZiZ+GuOrv1VYhC+mYz5zqBfydTQJenNzGD+AM=; b=jZ9SR+Uo8mIjpduP0Fq++ KBlpTHLf2wDD8BzcuLO56OMLGSqmdeBLNYy0i4PHH8vYi2JM+j0LufixmKpnzq86 4is0efWBRIL11rz+oPVIEFYhfdkU7QLRoFSyUW2cGsX93WbatGO0Ev96geMmT0zY 5Exq2Ngvi/0MiEaKseWHVU= Received: from localhost (unknown [101.86.213.121]) by smtp9 (Coremail) with SMTP id DcCowACn9ir12OJf4AawXQ--.17510S2; Wed, 23 Dec 2020 13:43:17 +0800 (CST) Date: Wed, 23 Dec 2020 13:43:17 +0800 From: Hui Su To: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sh_def@163.com, songmuchun@bytedance.com Subject: [PATCH v2] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg() Message-ID: <20201223054317.GA1518010@ubuntu-A520I-AC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CM-TRANSID: DcCowACn9ir12OJf4AawXQ--.17510S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKw43Wr1UKF18XF47Zw18Zrb_yoWfCFg_CF 4Iyryxta9rAr4S934vy3Z5Xr92krW7Xr1jy343tay7AFWIgFWrCw17AFZxX393GayfC3s8 J3WkXry5KF40qjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRirb17UUUUU== X-Originating-IP: [101.86.213.121] X-CM-SenderInfo: xvkbvvri6rljoofrz/1tbiJhUEX1v2fmOcoAAAsk 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: Hui Su --- 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