Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3565604rwl; Sun, 9 Apr 2023 19:24:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bxDoYsM1YstIcoKWifpnDQq0ock8xCbb0QiIfU7P0Jj0dbcxjODt+qAooORM4M3+hbh62m X-Received: by 2002:a05:6a20:7b08:b0:da:eb84:fcff with SMTP id s8-20020a056a207b0800b000daeb84fcffmr5676969pzh.29.1681093472199; Sun, 09 Apr 2023 19:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681093472; cv=none; d=google.com; s=arc-20160816; b=KewKH7gSbj3kuYU2VFPWgIULsO/GZvwrdD2fihxYim9O1oAvmPpBOkhHTZdMReBjSi Dj5dqZrhLaBosECsSZTg4Qw4s/Fz0oZEe55ODirxprBLTwtGq01ycy1Sd2bR9uUIowuB yv4byuqbuZVbafBBpGzgE+hG1kgtfWTrjzkjBB6YyzpCd5cEZylR8fGH7TAE/t+gqbZL NmOp83FHpmJfROe3pWIAhoQcL/40m/4Mdff5iEC9cxrIt1pPNb3hbhRwOv9UDJK0hQSF 8sDMoRVdnisadHghPCFeeb4IqFtevdabcCyXoVxIU9iq64HYhA0IqArzV5OwXl7EjN15 PaTQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=L22VA8wyXhaH46f3Y7JGoCdAtQNOn1kgfzKE3dW4TgE=; b=YQIBpqsuPP1tnGro3SFM5lvKNJTCZ9R/RRI/HhmwiLlHoLO8B4aUH5lY4/ihq65Ei3 BxiSS9QtwYbN1ujhArKKg5zorm78OG6mBPB1TvGV2hmjZY5NDR71NzIeuoAIHNQxEQWB GWl4iWKxW24yztyhkTdNIr/KPCe/DntYS5OD+3zzyij9oMW8wh0NDRreoTMF+FEDCTSz 2RkrVIVO1vK0MgHqIlzWuENYVVBT6NloDzbMmr3WOu9ihDAvR8GRzEhRlovjC/oBRsd9 ndZtVGhubzG0dZlo0eqbDzlFsvpkm+zvzOTvZdz44Nsn9nn+PGF9f23KZkA6owIeh/+v 2b0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dh2D5sgN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a63fc11000000b0050309caf60esi9272490pgi.750.2023.04.09.19.24.21; Sun, 09 Apr 2023 19:24:32 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dh2D5sgN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjDJCUZ (ORCPT + 99 others); Sun, 9 Apr 2023 22:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjDJCUX (ORCPT ); Sun, 9 Apr 2023 22:20:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A28F30E3 for ; Sun, 9 Apr 2023 19:20:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 34E1A60D41 for ; Mon, 10 Apr 2023 02:20:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61513C433D2; Mon, 10 Apr 2023 02:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681093221; bh=HwCOx5xRy3GdD+M/EnsNjrEY2Cu6MG8VzpDDAD4BMUU=; h=From:To:Cc:Subject:Date:From; b=Dh2D5sgNAfWB0M966BgWaici/0xOyy4b9b4KM0EyKesTAx4HMLa0OPU0pf73J6c5g OLZBeSSMJjNU+Bw4zc1TJdZJ+ubO23vf+5JQovX27Y3vWt+BrMSpvby4tRtBy2qkH7 wqVqDT0zWlbfVkRQo5qlTxqg4iEeG+jd6ITrmcs7tfQjcltPt01TOFZfyKnRwje+ID lwVpJXYqGMGMh8tT+mm2XEVXy3p4hy3UFiq8tK8GnRxfqQObDCoINKqeDuTU9CYEI1 lRwV2WmSG8fNnxcdfddY4CxJS59ZGbERxTCd6DCYpgjsb6/h6EMt9eM37hvV4BepFy sRhYcCI7qNj8A== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH] f2fs: remove unneeded in-memory i_crtime copy Date: Mon, 10 Apr 2023 10:20:12 +0800 Message-Id: <20230410022012.1839127-1-chao@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 i_crtime will never change after inode creation, so we don't need to copy it into f2fs_inode_info.i_disk_time[3], and monitor its change to decide whether updating inode page, remove related stuff. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 5 +---- fs/f2fs/inode.c | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 7d9c5a65f974..e78cbc8a6248 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -844,7 +844,7 @@ struct f2fs_inode_info { kprojid_t i_projid; /* id for project quota */ int i_inline_xattr_size; /* inline xattr size */ struct timespec64 i_crtime; /* inode creation time */ - struct timespec64 i_disk_time[4];/* inode disk times */ + struct timespec64 i_disk_time[3];/* inode disk times */ /* for file compress */ atomic_t i_compr_blocks; /* # of compressed blocks */ @@ -3290,9 +3290,6 @@ static inline bool f2fs_is_time_consistent(struct inode *inode) return false; if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) return false; - if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3, - &F2FS_I(inode)->i_crtime)) - return false; return true; } diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index bb5b365a195d..cf4327ad106c 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -326,7 +326,6 @@ static void init_idisk_time(struct inode *inode) fi->i_disk_time[0] = inode->i_atime; fi->i_disk_time[1] = inode->i_ctime; fi->i_disk_time[2] = inode->i_mtime; - fi->i_disk_time[3] = fi->i_crtime; } static int do_read_inode(struct inode *inode) -- 2.25.1