Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp480423lqh; Tue, 7 May 2024 05:28:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUc3El9tAu09vE83AB9Y56mThHVfnLO/KaUXuWVzJfaodbDwjpCjP9lmZTEFeAZ3La9BusYePqDF8Ibn5OUuGk4VYb3rqpeRfQJFnbHIA== X-Google-Smtp-Source: AGHT+IGrrtdn0KLGx8D7BYqO3jMknfZ9WGf0uq1iss7DUUebEmA5MmriZ6BNzFCeCvQk24OywT4S X-Received: by 2002:a50:9516:0:b0:572:4faf:ed67 with SMTP id u22-20020a509516000000b005724fafed67mr7992624eda.24.1715084923133; Tue, 07 May 2024 05:28:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715084923; cv=pass; d=google.com; s=arc-20160816; b=gN1bJNUHWiK4fzHs8ZRCbbCleazOtG0l5kfkmMqetm9Gtbo/TA33D3WF1sXdaDgA7S Z+Mq1OXCmVYY8j2uq5eJBPVKH36HnOATr9AezJBnLe0rX4vBXVnkZEBU2KVMdIAWNnVn MQV4W2Auk5lbSxy3Aw2fkRDhO9HS9DVcPKJdNr3x8g9KHdud0SLHwOX3520/Pd721dAx 4LavBK8m3O2QgNYBy+7eS1ytl7yUbH7l6uzRy2tCGQtJo3rrHLlG7dhHaw/Bn/TTUmWo wfeAV5Z4d3WIrGa+6jdknMlLsZl1DrChHfANNKD/O3DvnpzmOMgCH7QpQlJPTS6QSb+g Ax2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=+nWUtTqRLOQMtW1YcP3myH5or8dWYh5oH8YXF7vpp2k=; fh=FRcBP0I06aY7ToGMbvMdr020jH37lbE69vxFbSyM9oE=; b=jAqY5e32jqFK48/JnDJJklOY+0J+mrP9cHrE3ZJR9xvFTZchCo1W8rHhcvcThGClmE 6Tt3jt57+2wUEtPZ0k6P5xdvsdkZun/kHh32UD1/cJ6AXFa0TPI5h0Ws5I0/NKuLmE28 hWt5F84xE8yww9NcFhwqLnWpSNNVCL+d4tJR03kjv4m0LgWxMRXt5Kyea3j1czfTm1FG TEFP/4yqL3jdEr3sy4GPEZAdziXiWfALlXYi5+XcOElRRIOEx+GkjjnFW3dqyKOOX6K3 PNMF3/2AMvqEWcxAwmFteBV0+lgvkNMoyDSJdy5lIgL6ZfFJdt84wI9sYwi2DDSvl0jd ff4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-ext4+bounces-2342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i2-20020a50d742000000b00572e1be986dsi4189347edj.297.2024.05.07.05.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 05:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2342-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=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-ext4+bounces-2342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 D85151F25D28 for ; Tue, 7 May 2024 12:28:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93182158D64; Tue, 7 May 2024 12:28:35 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 1EDCF136E2D; Tue, 7 May 2024 12:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715084915; cv=none; b=BseTC0wfo3w/TVAvHPvG5et2HHzJSk8sZnr4tqJ1tzLTAMTS/vts135UsnkDSpXdcPu5d9etVKIhpENX3YeAp4zxzqjTaQeccShGU4TbikffiWEocnqUOKptrn/i4Txtn0FjMH/GHKh1lmNwGyGYCFw/35eDHfQF4eIzp4yZOlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715084915; c=relaxed/simple; bh=3JOaCAMqGM8SN7hFZlLZhsfsb/fSBi2VfSkgmmLFYro=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=qQ4ikBLeG5Fnp5gDFYyPy3dEtl9LpfRSAei/YkSDEnNq16iOScKnD2YLmBUddLYbodKH3law8xYs9jl63LcXb7vIoh88V1sNb4+mbmzzc2e9siCaV/IUYPwSTziF+fOHi8W0mHMr66Sj9DehMNZwitcSDb5euKwb+TOYJyLo4XI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VYcwh06TBzCrLN; Tue, 7 May 2024 20:27:16 +0800 (CST) Received: from canpemm500005.china.huawei.com (unknown [7.192.104.229]) by mail.maildlp.com (Postfix) with ESMTPS id ABE92180073; Tue, 7 May 2024 20:28:26 +0800 (CST) Received: from [10.174.179.80] (10.174.179.80) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 7 May 2024 20:28:26 +0800 Subject: Re: [PATCH 3/9] jbd2: remove unnedded "need_copy_out" in jbd2_journal_write_metadata_buffer To: Kemeng Shi CC: , , , References: <20240506141801.1165315-1-shikemeng@huaweicloud.com> <20240506141801.1165315-4-shikemeng@huaweicloud.com> From: Zhang Yi Message-ID: <4c263b90-6226-c2bf-f3e5-3b15cd576aa7@huawei.com> Date: Tue, 7 May 2024 20:28:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240506141801.1165315-4-shikemeng@huaweicloud.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500005.china.huawei.com (7.192.104.229) On 2024/5/6 22:17, Kemeng Shi wrote: > As we only need to copy out when we should do escape, need_copy_out > could be simply replaced by "do_escape". > > Signed-off-by: Kemeng Shi Make sense, looks good to me. Reviewed-by: Zhang Yi > --- > fs/jbd2/journal.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index 068031f35aea..9a35d0c5b38c 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -327,7 +327,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, > struct buffer_head **bh_out, > sector_t blocknr) > { > - int need_copy_out = 0; > int done_copy_out = 0; > int do_escape = 0; > char *mapped_data; > @@ -382,16 +381,14 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, > /* > * Check for escaping > */ > - if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) { > - need_copy_out = 1; > + if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) > do_escape = 1; > - } > kunmap_local(mapped_data); > > /* > * Do we need to do a data copy? > */ > - if (need_copy_out && !done_copy_out) { > + if (do_escape && !done_copy_out) { > char *tmp; > > spin_unlock(&jh_in->b_state_lock); >