Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30318609rwd; Thu, 6 Jul 2023 04:19:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5njzQTA4KSVOjTH9K1Nhgm1nm/k6wdv7zjuXBU8vixSe2HZIWs261FaP0Vr/SSdSKsTBv X-Received: by 2002:a17:902:ce8d:b0:1b8:400a:48ea with SMTP id f13-20020a170902ce8d00b001b8400a48eamr1695784plg.63.1688642378779; Thu, 06 Jul 2023 04:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688642378; cv=none; d=google.com; s=arc-20160816; b=f4XGJkxZnRsfkMpJjzdQoFPa1AqzKnwYLfap1iXoLOuae+P1FM9vsdJ0uOc94v4G+g XM53oV/jm16RXB6N69EStLIMdGHvZ5aV57adew6PPGSarDBVCPfDHSw/uShHSH+h2Y2m FS30S78e9Xe995K7fJWBBUHSQe2AtrlFsOxBCnb/OGkTZ6R+ayFPrAQkVAngt5iTZ8j1 +tgo6P43ya4TJqQ/g2WG+45K5y3fSM9te8fU3ECXbolVsshy7IQcYpV5pxi9urb7P43n 5wlgOcV07foEf2dY/V10ZkTadGePaA1BqNp17GeqB0ycJ1NX2a2RAL1bkPoKRmjkmi8T WRPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=o59loy7P5goXuOwROmMcknoofaYv/jkeBlMR/y1cCV0=; fh=Lhk4rAweV/k2JKEFSwoyHQ4XNcnoYHp4gnOpiuy/7ew=; b=m1TCiI7A2PVuB5h36dKAZEX8ImTSEU5YZVTtEYp7TCr8oS6/ko3pOYHQv30qEHaiPc 9+UU7h7mNNzTl6P5r21swSkAf1TQxYq/RP7/gTbshODE4akpHGH0TQ2Ui+XePb/BVwHc RDgwBVDQuPO0D6nWzGfZ0IZpUTOmbb3eMfoRhsHCi5MptA5ZDirZWS+0uYe38INHoekE pj1CUMRsNa6vpujCkKhXaW8R41+ySvN4UYz7lPa2PP5JFJtlzkGV2qDk5P1ap9W6Z0RP tBGPnqlrxown1MWus7188B8MYx3ePhd6FXkENC/xJJNlMFLycJF4Mj7dpYZ9KrqKTAi6 vI2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="FWAiA/LE"; dkim=neutral (no key) header.i=@suse.cz header.b=1LwmpTqI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a170902ea8b00b001b84335fb90si1040701plb.286.2023.07.06.04.19.24; Thu, 06 Jul 2023 04:19:38 -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=@suse.cz header.s=susede2_rsa header.b="FWAiA/LE"; dkim=neutral (no key) header.i=@suse.cz header.b=1LwmpTqI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbjGFLBq (ORCPT + 99 others); Thu, 6 Jul 2023 07:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjGFLBp (ORCPT ); Thu, 6 Jul 2023 07:01:45 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5A349F; Thu, 6 Jul 2023 04:01:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A4AF82053A; Thu, 6 Jul 2023 11:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688641302; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=o59loy7P5goXuOwROmMcknoofaYv/jkeBlMR/y1cCV0=; b=FWAiA/LEPTOaoX6hjmjZPnw3al59DSzqJD0InUjwaedy1kV8rmWk+iGWH9y0WGSPRbt/n4 ZHS5Zdg3/r9jovIw3Wglax+A9RiBHkAHMAy+o/SR1GlqiF2eYqu7lDy1TJAFMc9WeXrTbW 5PbQVeL2Lp0DwbiK7teRG9soy9qzJjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688641302; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=o59loy7P5goXuOwROmMcknoofaYv/jkeBlMR/y1cCV0=; b=1LwmpTqITJd4nmGxFJTomL7xzXPMO5OsYJxLHEe2nEWGWj7VSrTPFyDRLHFJoe4DWZZOw5 Qjmq8EmoMj22M3CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 93C0C138EE; Thu, 6 Jul 2023 11:01:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ELQPJBafpmT8CAAAMHmgww (envelope-from ); Thu, 06 Jul 2023 11:01:42 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 1ECC3A0707; Thu, 6 Jul 2023 13:01:42 +0200 (CEST) Date: Thu, 6 Jul 2023 13:01:42 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Namjae Jeon , Sungjong Seo , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 40/92] exfat: convert to ctime accessor functions Message-ID: <20230706110142.lxisom262crklz5u@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-38-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-38-jlayton@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,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 On Wed 05-07-23 15:01:05, Jeff Layton wrote: > In later patches, we're going to change how the inode's ctime field is > used. Switch to using accessor functions instead of raw accesses of > inode->i_ctime. > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/exfat/file.c | 4 ++-- > fs/exfat/inode.c | 6 +++--- > fs/exfat/namei.c | 21 +++++++++------------ > fs/exfat/super.c | 3 +-- > 4 files changed, 15 insertions(+), 19 deletions(-) > > diff --git a/fs/exfat/file.c b/fs/exfat/file.c > index 3cbd270e0cba..f40ecfeee3a4 100644 > --- a/fs/exfat/file.c > +++ b/fs/exfat/file.c > @@ -22,7 +22,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) > if (err) > return err; > > - inode->i_ctime = inode->i_mtime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > mark_inode_dirty(inode); > > if (!IS_SYNC(inode)) > @@ -290,7 +290,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, > } > > if (attr->ia_valid & ATTR_SIZE) > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > > setattr_copy(&nop_mnt_idmap, inode, attr); > exfat_truncate_atime(&inode->i_atime); > diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c > index 481dd338f2b8..13329baeafbc 100644 > --- a/fs/exfat/inode.c > +++ b/fs/exfat/inode.c > @@ -355,7 +355,7 @@ static void exfat_write_failed(struct address_space *mapping, loff_t to) > > if (to > i_size_read(inode)) { > truncate_pagecache(inode, i_size_read(inode)); > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > exfat_truncate(inode); > } > } > @@ -398,7 +398,7 @@ static int exfat_write_end(struct file *file, struct address_space *mapping, > exfat_write_failed(mapping, pos+len); > > if (!(err < 0) && !(ei->attr & ATTR_ARCHIVE)) { > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > ei->attr |= ATTR_ARCHIVE; > mark_inode_dirty(inode); > } > @@ -577,7 +577,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info) > > inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9; > inode->i_mtime = info->mtime; > - inode->i_ctime = info->mtime; > + inode_set_ctime_to_ts(inode, info->mtime); > ei->i_crtime = info->crtime; > inode->i_atime = info->atime; > > diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c > index e91022ff80ef..c007de6ac1c7 100644 > --- a/fs/exfat/namei.c > +++ b/fs/exfat/namei.c > @@ -569,7 +569,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, > goto unlock; > > inode_inc_iversion(dir); > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > if (IS_DIRSYNC(dir)) > exfat_sync_inode(dir); > else > @@ -582,8 +582,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, > goto unlock; > > inode_inc_iversion(inode); > - inode->i_mtime = inode->i_atime = inode->i_ctime = > - EXFAT_I(inode)->i_crtime = current_time(inode); > + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); > exfat_truncate_atime(&inode->i_atime); > /* timestamp is already written, so mark_inode_dirty() is unneeded. */ > > @@ -817,7 +816,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) > ei->dir.dir = DIR_DELETED; > > inode_inc_iversion(dir); > - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); > + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); > exfat_truncate_atime(&dir->i_atime); > if (IS_DIRSYNC(dir)) > exfat_sync_inode(dir); > @@ -825,7 +824,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) > mark_inode_dirty(dir); > > clear_nlink(inode); > - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); > exfat_truncate_atime(&inode->i_atime); > exfat_unhash_inode(inode); > exfat_d_version_set(dentry, inode_query_iversion(dir)); > @@ -852,7 +851,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, > goto unlock; > > inode_inc_iversion(dir); > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > if (IS_DIRSYNC(dir)) > exfat_sync_inode(dir); > else > @@ -866,8 +865,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, > goto unlock; > > inode_inc_iversion(inode); > - inode->i_mtime = inode->i_atime = inode->i_ctime = > - EXFAT_I(inode)->i_crtime = current_time(inode); > + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); > exfat_truncate_atime(&inode->i_atime); > /* timestamp is already written, so mark_inode_dirty() is unneeded. */ > > @@ -979,7 +977,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) > ei->dir.dir = DIR_DELETED; > > inode_inc_iversion(dir); > - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); > + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); > exfat_truncate_atime(&dir->i_atime); > if (IS_DIRSYNC(dir)) > exfat_sync_inode(dir); > @@ -988,7 +986,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) > drop_nlink(dir); > > clear_nlink(inode); > - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); > exfat_truncate_atime(&inode->i_atime); > exfat_unhash_inode(inode); > exfat_d_version_set(dentry, inode_query_iversion(dir)); > @@ -1353,8 +1351,7 @@ static int exfat_rename(struct mnt_idmap *idmap, > exfat_warn(sb, "abnormal access to an inode dropped"); > WARN_ON(new_inode->i_nlink == 0); > } > - new_inode->i_ctime = EXFAT_I(new_inode)->i_crtime = > - current_time(new_inode); > + EXFAT_I(new_inode)->i_crtime = inode_set_ctime_current(new_inode); > } > > unlock: > diff --git a/fs/exfat/super.c b/fs/exfat/super.c > index 8c32460e031e..8e0ca4b0fc8f 100644 > --- a/fs/exfat/super.c > +++ b/fs/exfat/super.c > @@ -379,8 +379,7 @@ static int exfat_read_root(struct inode *inode) > ei->i_size_ondisk = i_size_read(inode); > > exfat_save_attr(inode, ATTR_SUBDIR); > - inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = > - current_time(inode); > + inode->i_mtime = inode->i_atime = ei->i_crtime = inode_set_ctime_current(inode); > exfat_truncate_atime(&inode->i_atime); > return 0; > } > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR