Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2620089lqo; Tue, 14 May 2024 04:37:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXm9Dyic1/YMiWYpCtwo3MQ4+JpkLKDSxTUGxWkN5uE9yecrhl7o6ACGKcMU+76GoRWyJmORXo3Ze1uYBGKGZWDhwq636l+3/Sls/ThgA== X-Google-Smtp-Source: AGHT+IEFXUNWfvmwuUYzOdrMmBs7XmldqR1ZRm89uJtihIdy5dm0iF0tBPpJQaSxFeUl4MEKyt2k X-Received: by 2002:a17:906:31d7:b0:a59:c7d9:9d39 with SMTP id a640c23a62f3a-a5a2d54c0b5mr863589066b.10.1715686661365; Tue, 14 May 2024 04:37:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715686661; cv=pass; d=google.com; s=arc-20160816; b=XPF52o1Jygc+nd3HDTQQTUbXPH/6Pcrc6G7va8kWT86kT0dV1j6i2zmdo5UCsmmcCt 5OrtKDz2s2vUNgQxKf8Nn7LUuQVliACbFzwtprUu22mn+0hThGaYulPrC1cmCbKAr0H7 OOtb/Qhr03Bj65BEqfEMSmyQIOCrc6mG6AKG0fcNew/2oX4aKHkvecHotcETsfBEv0y0 2dInku+KY56UuapemQ3F13PorBx6qdPnKYxT4HSxw9kfeg3QEKiNrxREV4MMmYXLLM5+ v8JgQBcVR1TT6Mq7cWZq94pVcRMvJ3K6wayZn4WeRzDa4tCfsrhzgRV8TpxJzHh3FTx0 lXog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kO9vcxY7YjyZi7h98z86rIhcY67TSIn2/6t085d06fE=; fh=pf8pn/cVufM2NIipJP2kqbdMWZvciRNVzwZXvJNpV+Q=; b=h1SfXGPkWWJYMaye1hwdkDcR5Ul+w39f0qr9jgYDPwwFHsdYNLHpLHy748bTPmYbbH eCZ3WeofJ/HtUW5ZWDKP/BO0U3Kg4fD+Q2rimeqnVDjNpPvoDmDD2JzToDpOR46Iq1uJ zohEyDjkSYIkBwMyXBxvidoEPj0zD17OUtwRKDtu5Q1OeKqdbDbFc8c6/8SkiMXf/Jiy sX1uFYUHA2AdIRHnbFONI9zBNu/2qKUqhYZcw+zSelseFOAB0akwxz4klvj03H40lbcO Sy3cpeQ3kT9/fjG2G7Ns5la1z+r6TjB4Bv5eoi2EjNUcSvV0wkiNLoS24iOL5MCwho6s YTgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-178597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178597-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a179466ddsi629777866b.77.2024.05.14.04.37.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 04:37:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-178597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178597-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 208B61F21CF0 for ; Tue, 14 May 2024 11:37:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71B5713D8B2; Tue, 14 May 2024 11:25:20 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1830013D526; Tue, 14 May 2024 11:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715685919; cv=none; b=YBvOGoXWDrpsZUQ2rI22HvCtF4z6+Z6Pf0fGDQLAVk13SvteQ/PhluVqKTvj1MTtsHddbo3yOCvSqcIEUd+HnD1S5XYZ8fM7RagQLgD6cCvhG2BQQyF2Oy/4Zu9RMmY6MbUhd6Z3woJDX4qoPWZldixy97pWUiVbzbyXmMV7vjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715685919; c=relaxed/simple; bh=nbz2Rlgxu9u1KRDuvifEH66jIHug+MUvC5/Vn3CrnQ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pHKckiyelDriJK209+flh3ZG2sRfzl384KMfjL+UkTA1sDuMqHgXU2+/vroeDEphzsIduGsNHT6AqeDXboDqJu5XT2+S2pLxaPAWzWoD/LIS0P9+3KKHw1vaOfKD++IbRv7lkcimGV4KXa6QzqnfWdW4YuUqmZotUU07nD4H4XU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VdvCh5mMlz4f3n66; Tue, 14 May 2024 19:25:04 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id E851A1A016E; Tue, 14 May 2024 19:25:14 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP3 (Coremail) with SMTP id _Ch0CgCHSKAXSkNm4rTMMQ--.61831S7; Tue, 14 May 2024 19:25:14 +0800 (CST) From: Kemeng Shi To: tytso@mit.edu, jack@suse.com, yi.zhang@huaweicloud.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/9] jbd2: remove unneeded kmap to do escape in jbd2_journal_write_metadata_buffer Date: Tue, 14 May 2024 19:24:34 +0800 Message-Id: <20240514112438.1269037-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240514112438.1269037-1-shikemeng@huaweicloud.com> References: <20240514112438.1269037-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_Ch0CgCHSKAXSkNm4rTMMQ--.61831S7 X-Coremail-Antispam: 1UD129KBjvdXoWrZw1DXr4kXr4rKF47ZFy7KFg_yoWkGrg_Xa nYvrZ5uwsxXrnrJr4Fka13urWFg34rKr1kuF10q3W7Gr10q3WxGrnxKr4vyrnruw40kr45 XF909r4rtasFqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbTxFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMx C20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAF wI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20x vE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v2 0xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxV W8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbmZX7UUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ The data to do escape could be accessed directly from b_frozen_data, just remove unneeded kmap. Signed-off-by: Kemeng Shi Reviewed-by: Zhang Yi Reviewed-by: Jan Kara --- fs/jbd2/journal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 5fb5062cf7ae..c98c06f3113a 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -419,12 +419,11 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, /* * Did we need to do an escaping? Now we've done all the * copying, we can finally do so. + * b_frozen_data is from jbd2_alloc() which always provides an + * address from the direct kernels mapping. */ - if (do_escape) { - mapped_data = kmap_local_folio(new_folio, new_offset); - *((unsigned int *)mapped_data) = 0; - kunmap_local(mapped_data); - } + if (do_escape) + *((unsigned int *)jh_in->b_frozen_data) = 0; folio_set_bh(new_bh, new_folio, new_offset); new_bh->b_size = bh_in->b_size; -- 2.30.0