Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3947581rwd; Mon, 29 May 2023 20:40:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fhwQHjJ6lzbjOI5pSx/kCdOTNq2Hmq58+UMSrwwSzrWx71Y3xfElJjhvOyrt/A+BcvbI0 X-Received: by 2002:aa7:88cf:0:b0:64f:7c9d:9c01 with SMTP id k15-20020aa788cf000000b0064f7c9d9c01mr935622pff.30.1685418011611; Mon, 29 May 2023 20:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685418011; cv=none; d=google.com; s=arc-20160816; b=aG64q9iCbake0oJ6SGGIx3pGvw2kseoDvoJkBENJ4fA1ZIMdSYx4yVDM2kMgvxUhnT nUNA4rAEul5+0SWd8Zagwq8NXGycBLLUAbgIlCmhMA57dsZLkM6wolok8tMa7J4ApB3E W/Hf0qcHoF/0zzTGRm1ggwTiEJfag/xQlGGEgsTLZf7fCBi4SBlDiHv1ZwLwqkGDN9aW 0nDx3Ku+AdQJ2s9ZwkiPfV2G7XM4gn3TdmT45CO/XXfrlofIqOLfxVesclZJ47ZOWVgS +XgJsIFkUWbll6MbqzMpQyNcT/okx9xFmwBegg4HudKlde8d6LVRhYqW3fcJtu10kaIj 36lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=s7DkmPWSvoZsJWexi+C3T0oqdA9SocP75xrMDbAK8Co=; b=EY4CyqhPUt1HvH8vLtuPFf8tdZHGpuUatDfr05iru6z7LYq4CtGmzyKG6IuJ8ghaVe 06XRN3/DyeSzVvguuxuIg7ZkcgXLhje04N9DPF0dGWMkkAb5avA3pWrqqn7dq1QxadOv W49FdPfLgo+k1Q+ahf/+r938erUMGPp0gXR/jdbXC841JL3P1MPdDE2wPcfxy17xDfRB Usgq9eXjEd8l8QGLTAxC4qsmx/l51C+AlI/vJhMnqut3vwsVgtv6QH2iBr7fgYyAfORR c+eKw5V9/ztAq7qHO6LY1tW9W1vzqFE0ZjQwTG3odkzPxKhp78KGshoaGh9mu66M6Nyt 09wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a624e07000000b0064dc66287cfsi612025pfb.279.2023.05.29.20.39.58; Mon, 29 May 2023 20:40:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbjE3DdY (ORCPT + 99 others); Mon, 29 May 2023 23:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjE3DdW (ORCPT ); Mon, 29 May 2023 23:33:22 -0400 Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF93C9; Mon, 29 May 2023 20:33:12 -0700 (PDT) X-QQ-mid: bizesmtp84t1685417562t8wq2x3p Received: from localhost.localdomain ( [113.200.76.118]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 May 2023 11:32:41 +0800 (CST) X-QQ-SSF: 01400000000000C0G000000A0001000 X-QQ-FEAT: uGhnJwy6xZIa4gIS+jDjc06YMsYLdchXgk3LHYba6K8g4kaZI58NW9IZ70lCx 5cr5DUrlSQBm9FHK8DnL0Rq6y/n89ytPLY9sK45p60ngxh7kJB52jYPlxRVeQZ1m2vB+A7h OKyPJBubLG8o9n44Us/9Hb59W1ezLWkzCwgkWTY7ljCo0DvXh9PG6Uewiqo9ajlvlvgVKQ9 /dmdj3tPvLOpepy1AEeadSptbdrRzP8N4s+n+6dR9EG6b4mbhKtfpU94sjMILIIkexiPYZ3 ueDO4nkAJz5MPRVIfd7m5Uw+Xx9sxkoz/MvkgJBwIuDMJ0iwAHDBAwkprYz8nItvn7MjCqK ebBWuCUlertEnRVyc+rWw6yGg0me0P7N7L01pUXyMtojmuuz6pXCVGIDEf4hhtNaHDvlUnx X-QQ-GoodBg: 1 X-BIZMAIL-ID: 171752197749127171 From: gouhao@uniontech.com To: viro@zeniv.linux.org.uk, brauner@kernel.org, axboe@kernel.dk Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc() Date: Tue, 30 May 2023 11:32:39 +0800 Message-Id: <20230530033239.17534-1-gouhao@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvrgz:qybglogicsvrgz7a-0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gou Hao In submit_bh_wbc(), bio is newly allocated, so it does not need any merging logic. And using bio_add_page here will execute 'bio_flagged( bio, BIO_CLONED)' and 'bio_full' twice, which is unnecessary. Signed-off-by: Gou Hao --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index a7fc561758b1..5abc26d8399d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2760,7 +2760,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); BUG_ON(bio->bi_iter.bi_size != bh->b_size); bio->bi_end_io = end_bio_bh_io_sync; -- 2.20.1