Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9517329rwd; Wed, 21 Jun 2023 08:22:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52/fdlQOy3T0H3iD2tITFqWuivwGLtR+Nwh0oTDNzDimAe8N6CEp+3h1xnJG5VYuNp5aX2 X-Received: by 2002:a17:902:7c8d:b0:1b1:753a:49ce with SMTP id y13-20020a1709027c8d00b001b1753a49cemr9458186pll.53.1687360969055; Wed, 21 Jun 2023 08:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360969; cv=none; d=google.com; s=arc-20160816; b=rB03yiE9Iw1M1fwCGd3kVyUJr2EKHfLGw7pKVmKNN7x4ru5WItpsmEypzkHQX+0XN0 3OWcAm9eRgUSgCZpMObEHK6DbNWhkAP+ZMJlxga+1LsAmRgFu+Oe5MhcYlMZ5JUjech/ hJeZtUzWam/BVTtPKCgZU//jzzo9ar6wjSLzj+DLEYHPGWcFPkzB/wj7K+ny3sxRQeR0 hJT3KeW1EmlPngmtYs/UkH3nhpRi6Vo28rDGrgZQfQzr5rdX9xgFOH+oVhwBhy5dd4A5 jxNOiDTuVGVbkFuBXblHGRDi11ZXDfUZb4+kJ0aJeV0yCzdzmP6fvLi2h2gaE/cgofs8 a6nw== 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 :dkim-signature; bh=D7PLAJyorYyoJ/OIxK6bLCauLwiRh2V/xATgES0tX/w=; b=dNonOkyuQz3niOs6YI8cwexEkIW+4Whnc/rbSknoVPvNl5PpMHIY9KEQ+dHxwS8piJ 2j5vZeQEL9vd/6OEaH07lu9tKhc6Bkke/yDaxJ2fSQxK28sm3DRW+isB/aYHGoZmxn7j fK3ZEANOiNgjbEFekw2ph4kzY693Na2jDLvzchGB5MeMp8vcyaLifnCmdxV6xfXGCiYp FqyOrfZDylx7OwdGnfnJzB+A3y2tffH384XMqZxxQfOva66gz2p2MFVjF2rXCHEgSri/ EqS+eLQv9NVMvbMkcHojkgI4JieK5N/TTVJFabvdMcE6rIo5k3qQ8VxslH1gI9bBjQ5D fG8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DX/q6KXu"; 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 m7-20020a170902768700b001b11168bde3si4219998pll.521.2023.06.21.08.22.36; Wed, 21 Jun 2023 08:22:49 -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="DX/q6KXu"; 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 S232604AbjFUOvR (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbjFUOuD (ORCPT ); Wed, 21 Jun 2023 10:50:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF9D2723 for ; Wed, 21 Jun 2023 07:48:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8070061596 for ; Wed, 21 Jun 2023 14:48:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6702AC433C0; Wed, 21 Jun 2023 14:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358908; bh=Ozu8vusVt/ZPAtMPgGZ1LcgmA54r8kMF/Hvo6mj2P0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DX/q6KXulzPhf+oHWyMmvCGyi706ot1Qy0Pi395ff90XpXZI0hO7LfIudjPIKhYzc F/RGJ5d//DkWpgJdCc2adkI8XtqmH2qgNtmW2iCx4qwVCKCxEDJxFoLdroVZReCgFh NRyOlzEIEH02IhhA22k2LE9PRbbAuj55LwjKfCQyLfzX7SnTlE2k2xUT/FF5DzhepI 8rBrZ83aRfEctaAKZyefrUTET+nLRRcv9sf11A8VLPk5sCC1Q1sBAdYr74HyJeXIYo 2fmdVgDLMSJ0nePOf/zqm9RGcOwKNIQsZwPxgXgLJZB3DUisoMm1UVpzBpndpcrdC1 RX0lKMeAyXthg== From: Jeff Layton To: Christian Brauner , OGAWA Hirofumi Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 31/79] fat: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:44 -0400 Message-ID: <20230621144735.55953-30-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230621144735.55953-1-jlayton@kernel.org> References: <20230621144507.55591-1-jlayton@kernel.org> <20230621144735.55953-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-kernel@vger.kernel.org In later patches, we're going to change how the ctime.tv_nsec field is utilized. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/fat/inode.c | 8 +++++--- fs/fat/misc.c | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index d99b8549ec8f..b34ae7298796 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) & ~((loff_t)sbi->cluster_size - 1)) >> 9; fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); - inode->i_ctime = inode->i_mtime; + inode_ctime_set(inode, inode->i_mtime); if (sbi->options.isvfat) { fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime, @@ -1407,8 +1407,10 @@ static int fat_read_root(struct inode *inode) MSDOS_I(inode)->mmu_private = inode->i_size; fat_save_attrs(inode, ATTR_DIR); - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = 0; - inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode_ctime_set_sec(inode, + 0); + inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode_ctime_set_nsec(inode, + 0); set_nlink(inode, fat_subdirs(inode)+2); return 0; diff --git a/fs/fat/misc.c b/fs/fat/misc.c index 7e5d6ae305f2..0d3ba6001ff0 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -331,8 +331,11 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) * identical in memory. all mtime updates will be applied to ctime, * but ctime updates are ignored. */ - if (flags & S_MTIME) - inode->i_mtime = inode->i_ctime = fat_truncate_mtime(sbi, now); + if (flags & S_MTIME) { + ts = fat_truncate_mtime(sbi, now); + inode->i_mtime = ts; + inode_ctime_set(inode, ts); + } return 0; } -- 2.41.0