Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp699086rwe; Thu, 1 Sep 2022 06:27:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR5oujIB1Oim7otUjCZq5LN8OQFkAs3pMd1a7Up9+46cF47fWwk4abj6ob9kYLkH9MdiCZEq X-Received: by 2002:a05:6402:2793:b0:448:7c20:9b0b with SMTP id b19-20020a056402279300b004487c209b0bmr16549513ede.23.1662038865593; Thu, 01 Sep 2022 06:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662038865; cv=none; d=google.com; s=arc-20160816; b=S84cyN+OF5elkSFqmaaAYQin/VMrc9lopFo2EuD61ALTtC1DNNueY2sfH19SYtkRsi 9G1Bdnok+msGVex0TCQmGVZp7i6BfW6zZ4jsUkBGVQifZMgWCeyTOnkxJPP+t/Sz6n4T pbDDfxwTMV0cYaoH8g6prDU+irgA7kDnX6Qexs/2Z7YHq0iENZFv/wiKW/UWkXh3miJE wrdoLjDeTEczZWmTFM2u/EQLynupXGdLzXtg3Gm56Zamll/S7HMEC/cTl4ARBOS8wsg/ YI0usMGnQvRIoCc9Eqj6Prvpzj0PKblvrIQpZMUrO70XlEEwegOv4E3SoQInsPcMexTX deVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1L/WG0+z7/c+uYCEvqOdtJhmD96q9K1Bql07P3y1n/U=; b=kiPMs93mAyK253I8rx31ZV8ytLWKbvMRV5bU/t7TGm8X+nw+Yn1BrsUXBtMokY3Zh4 NSm+Yi9yDzwZx4dg0sKLutdkWU80f86XtaWdOPqGNjDFsiFpdZRQFSjvisCLQtpX7Oo5 UUQC2UQTQsaEsP66WdW/9scYthL2ms4K4iWNgSxm9FtfST3LE5WUfA27EGgZ14O2QBpQ MArz6h1riD3mhOy1Lhq1sn/atoLWmfqXea9G8DRdNbgufb/OY0qYjtxh4nwzgsQ+KHtd 19rXYPZRiLZLiWpZykRCPg72qWjAFY4qkXjbMRTAoyEfmDWT4FNYXSgSPkY+QzvO+C2w zqbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb12-20020a1709077e8c00b0073132e7e79bsi435542ejc.784.2022.09.01.06.27.19; Thu, 01 Sep 2022 06:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbiIAN0Z (ORCPT + 99 others); Thu, 1 Sep 2022 09:26:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234396AbiIANYe (ORCPT ); Thu, 1 Sep 2022 09:24:34 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86BD211A06; Thu, 1 Sep 2022 06:24:12 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MJMCd2n4QzHnXc; Thu, 1 Sep 2022 21:22:21 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 21:24:09 +0800 From: Zhang Yi To: , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v2 13/14] ext2: replace bh_submit_read() helper with bh_read_locked() Date: Thu, 1 Sep 2022 21:35:04 +0800 Message-ID: <20220901133505.2510834-14-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901133505.2510834-1-yi.zhang@huawei.com> References: <20220901133505.2510834-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org bh_submit_read() and the uptodate check logic in bh_uptodate_or_lock() has been integrated in bh_read() helper, so switch to use it directly. Signed-off-by: Zhang Yi --- fs/ext2/balloc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index c17ccc19b938..5dc0a31f4a08 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -126,6 +126,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) struct ext2_group_desc * desc; struct buffer_head * bh = NULL; ext2_fsblk_t bitmap_blk; + int ret; desc = ext2_get_group_desc(sb, block_group, NULL); if (!desc) @@ -139,10 +140,10 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) block_group, le32_to_cpu(desc->bg_block_bitmap)); return NULL; } - if (likely(bh_uptodate_or_lock(bh))) + ret = bh_read(bh, 0); + if (ret > 0) return bh; - - if (bh_submit_read(bh) < 0) { + if (ret < 0) { brelse(bh); ext2_error(sb, __func__, "Cannot read block bitmap - " -- 2.31.1