Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30490182rwd; Thu, 6 Jul 2023 06:44:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpcCywlGydGz9ZD74CaiK45Po8Hkg6r+aNL6uS3tBB+/HJ4ZkqTgEY6/2trt7raemH8+Yn X-Received: by 2002:a05:6870:6494:b0:1b0:25b4:4b7f with SMTP id cz20-20020a056870649400b001b025b44b7fmr2665221oab.27.1688651053019; Thu, 06 Jul 2023 06:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688651052; cv=none; d=google.com; s=arc-20160816; b=Bvtn0iryXczBcynLEgoHHWpkiy7m2Ouly7AzVKQDCese0Ok0gQgd8JtKsXO1qh0Gto NLB5pI5GttAyZRUbSUqLdszl2NtiEU6zUrmNtdgZKb1dmphruNl7ZRTBpX5zkE/o/WX2 OK4Qx8s5K8EsAQUeunlDMsGCH5C3UfQXnQjtjyb+5gNNn3R936wcP658HKVdXxYUNghi Jao2k435YmFPEcyj5N40ebShSnVeekWnZhjcKx/L9sdGZlfNIPgf8KyBjvPKyh0eyj8P U5OranhScNjFRsukFvPsj+Rp/kYYxIR2zwMQuabIXQTbAd8aVsG5+A0Kuc3IbueJuAJo pFPg== 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=9jiWKE4OzG6TzXYLixnatIY8nUy0TcM8xqgDtkKakcY=; fh=FSp7pkqTZqmTDmaLt8OuEV9PDB4iVPsb///Vo37qaUI=; b=X5WfrRkCpUZIsbYxrb7SlfX952nh3YmzG8KZbIQqvGubXZ47dJV4DISZSI0Gyn0cbX p8SrrBN4v5ZyBmtNDTmhGwZDelyevPmu8qoRxwul1oBVBdQbX9lw91sAzdCxxJr+Zl1K Jts/D/fFNcudi/77TzlOTNdQgRf3xbB9CkOz2Pxw1qoH1kOoFZE6lUrVOyziaNGIHB2z HmQJh+CyyXkx6fgCutPG5miOhjpAKUNovOnNopDCTxm2xKut7+wCuc1cV7heV9AqPwnz 5MGkfUvdeBgukAQ1z9hFxAurtKKbTBZ0b79BCGdGoVFW5IaenbT5Z7H6Wee3kXDihF99 rXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=z+VCj9+l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=qI3+T3Jn; 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 g70-20020a636b49000000b00534866eb2c2si1375008pgc.835.2023.07.06.06.44.00; Thu, 06 Jul 2023 06:44:12 -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=z+VCj9+l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=qI3+T3Jn; 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 S229831AbjGFN1u (ORCPT + 99 others); Thu, 6 Jul 2023 09:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbjGFN1s (ORCPT ); Thu, 6 Jul 2023 09:27:48 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 060FE1FD7; Thu, 6 Jul 2023 06:27:28 -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-out1.suse.de (Postfix) with ESMTPS id EF9832206D; Thu, 6 Jul 2023 13:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688650042; 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=9jiWKE4OzG6TzXYLixnatIY8nUy0TcM8xqgDtkKakcY=; b=z+VCj9+lDhEUOls9jjpIB1QJ0vzyrk/GzxzLb9XI1xFP2feDQK5uwFGiCzkoIFfJ6QFp5V 36Dyr1f3TuzQXY9MRL2ft4Z1PrJex47lMFeCIchSMWeUopN+gOJ6VdL3I97VdUYKBHeXom tNfYmFdXJwWJbxc65EQp8SIs1WSST64= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688650042; 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=9jiWKE4OzG6TzXYLixnatIY8nUy0TcM8xqgDtkKakcY=; b=qI3+T3Jn/YHkFlYcAKhJdQhmchgufcae9k6h7YE3NwIeP8hhGlQjznsr24u1+w9XezEP4E 9zEFTmp+bL8Gc9Dw== 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 C0971138EE; Thu, 6 Jul 2023 13:27:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BssBLzrBpmSjVgAAMHmgww (envelope-from ); Thu, 06 Jul 2023 13:27:22 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 4E08AA0707; Thu, 6 Jul 2023 15:27:22 +0200 (CEST) Date: Thu, 6 Jul 2023 15:27:22 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Dave Kleikamp , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Kleikamp , jfs-discussion@lists.sourceforge.net Subject: Re: [PATCH v2 55/92] jfs: convert to ctime accessor functions Message-ID: <20230706132722.wpzk2766amw2fz72@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-53-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-53-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:20, 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. > > Acked-by: Dave Kleikamp > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/jfs/acl.c | 2 +- > fs/jfs/inode.c | 2 +- > fs/jfs/ioctl.c | 2 +- > fs/jfs/jfs_imap.c | 8 ++++---- > fs/jfs/jfs_inode.c | 4 ++-- > fs/jfs/namei.c | 24 ++++++++++++------------ > fs/jfs/super.c | 2 +- > fs/jfs/xattr.c | 2 +- > 8 files changed, 23 insertions(+), 23 deletions(-) > > diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c > index fb96f872d207..1de3602c98de 100644 > --- a/fs/jfs/acl.c > +++ b/fs/jfs/acl.c > @@ -116,7 +116,7 @@ int jfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, > if (!rc) { > if (update_mode) { > inode->i_mode = mode; > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > mark_inode_dirty(inode); > } > rc = txCommit(tid, 1, &inode, 0); > diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c > index 8ac10e396050..920d58a1566b 100644 > --- a/fs/jfs/inode.c > +++ b/fs/jfs/inode.c > @@ -393,7 +393,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length) > break; > } > > - ip->i_mtime = ip->i_ctime = current_time(ip); > + ip->i_mtime = inode_set_ctime_current(ip); > mark_inode_dirty(ip); > > txCommit(tid, 1, &ip, 0); > diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c > index ed7989bc2db1..f7bd7e8f5be4 100644 > --- a/fs/jfs/ioctl.c > +++ b/fs/jfs/ioctl.c > @@ -96,7 +96,7 @@ int jfs_fileattr_set(struct mnt_idmap *idmap, > jfs_inode->mode2 = flags; > > jfs_set_inode_flags(inode); > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > mark_inode_dirty(inode); > > return 0; > diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c > index 390cbfce391f..a40383aa6c84 100644 > --- a/fs/jfs/jfs_imap.c > +++ b/fs/jfs/jfs_imap.c > @@ -3064,8 +3064,8 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip) > ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec); > ip->i_mtime.tv_sec = le32_to_cpu(dip->di_mtime.tv_sec); > ip->i_mtime.tv_nsec = le32_to_cpu(dip->di_mtime.tv_nsec); > - ip->i_ctime.tv_sec = le32_to_cpu(dip->di_ctime.tv_sec); > - ip->i_ctime.tv_nsec = le32_to_cpu(dip->di_ctime.tv_nsec); > + inode_set_ctime(ip, le32_to_cpu(dip->di_ctime.tv_sec), > + le32_to_cpu(dip->di_ctime.tv_nsec)); > ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks)); > ip->i_generation = le32_to_cpu(dip->di_gen); > > @@ -3139,8 +3139,8 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip) > > dip->di_atime.tv_sec = cpu_to_le32(ip->i_atime.tv_sec); > dip->di_atime.tv_nsec = cpu_to_le32(ip->i_atime.tv_nsec); > - dip->di_ctime.tv_sec = cpu_to_le32(ip->i_ctime.tv_sec); > - dip->di_ctime.tv_nsec = cpu_to_le32(ip->i_ctime.tv_nsec); > + dip->di_ctime.tv_sec = cpu_to_le32(inode_get_ctime(ip).tv_sec); > + dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime(ip).tv_nsec); > dip->di_mtime.tv_sec = cpu_to_le32(ip->i_mtime.tv_sec); > dip->di_mtime.tv_nsec = cpu_to_le32(ip->i_mtime.tv_nsec); > dip->di_ixpxd = jfs_ip->ixpxd; /* in-memory pxd's are little-endian */ > diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c > index 9e1f02767201..87594efa7f7c 100644 > --- a/fs/jfs/jfs_inode.c > +++ b/fs/jfs/jfs_inode.c > @@ -97,8 +97,8 @@ struct inode *ialloc(struct inode *parent, umode_t mode) > jfs_inode->mode2 |= inode->i_mode; > > inode->i_blocks = 0; > - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); > - jfs_inode->otime = inode->i_ctime.tv_sec; > + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); > + jfs_inode->otime = inode_get_ctime(inode).tv_sec; > inode->i_generation = JFS_SBI(sb)->gengen++; > > jfs_inode->cflag = 0; > diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c > index 9b030297aa64..541578126b1a 100644 > --- a/fs/jfs/namei.c > +++ b/fs/jfs/namei.c > @@ -149,7 +149,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip, > > mark_inode_dirty(ip); > > - dip->i_ctime = dip->i_mtime = current_time(dip); > + dip->i_mtime = inode_set_ctime_current(dip); > > mark_inode_dirty(dip); > > @@ -284,7 +284,7 @@ static int jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip, > > /* update parent directory inode */ > inc_nlink(dip); /* for '..' from child directory */ > - dip->i_ctime = dip->i_mtime = current_time(dip); > + dip->i_mtime = inode_set_ctime_current(dip); > mark_inode_dirty(dip); > > rc = txCommit(tid, 2, &iplist[0], 0); > @@ -390,7 +390,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) > /* update parent directory's link count corresponding > * to ".." entry of the target directory deleted > */ > - dip->i_ctime = dip->i_mtime = current_time(dip); > + dip->i_mtime = inode_set_ctime_current(dip); > inode_dec_link_count(dip); > > /* > @@ -512,7 +512,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) > > ASSERT(ip->i_nlink); > > - ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip); > + dip->i_mtime = inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip)); > mark_inode_dirty(dip); > > /* update target's inode */ > @@ -827,8 +827,8 @@ static int jfs_link(struct dentry *old_dentry, > > /* update object inode */ > inc_nlink(ip); /* for new link */ > - ip->i_ctime = current_time(ip); > - dir->i_ctime = dir->i_mtime = current_time(dir); > + inode_set_ctime_current(ip); > + dir->i_mtime = inode_set_ctime_current(dir); > mark_inode_dirty(dir); > ihold(ip); > > @@ -1028,7 +1028,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, > > mark_inode_dirty(ip); > > - dip->i_ctime = dip->i_mtime = current_time(dip); > + dip->i_mtime = inode_set_ctime_current(dip); > mark_inode_dirty(dip); > /* > * commit update of parent directory and link object > @@ -1205,7 +1205,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, > tblk->xflag |= COMMIT_DELETE; > tblk->u.ip = new_ip; > } else { > - new_ip->i_ctime = current_time(new_ip); > + inode_set_ctime_current(new_ip); > mark_inode_dirty(new_ip); > } > } else { > @@ -1268,10 +1268,10 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, > /* > * Update ctime on changed/moved inodes & mark dirty > */ > - old_ip->i_ctime = current_time(old_ip); > + inode_set_ctime_current(old_ip); > mark_inode_dirty(old_ip); > > - new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); > + new_dir->i_mtime = inode_set_ctime_current(new_dir); > mark_inode_dirty(new_dir); > > /* Build list of inodes modified by this transaction */ > @@ -1283,7 +1283,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, > > if (old_dir != new_dir) { > iplist[ipcount++] = new_dir; > - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); > + old_dir->i_mtime = inode_set_ctime_current(old_dir); > mark_inode_dirty(old_dir); > } > > @@ -1416,7 +1416,7 @@ static int jfs_mknod(struct mnt_idmap *idmap, struct inode *dir, > > mark_inode_dirty(ip); > > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > > mark_inode_dirty(dir); > > diff --git a/fs/jfs/super.c b/fs/jfs/super.c > index d2f82cb7db1b..2e2f7f6d36a0 100644 > --- a/fs/jfs/super.c > +++ b/fs/jfs/super.c > @@ -818,7 +818,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type, > } > if (inode->i_size < off+len-towrite) > i_size_write(inode, off+len-towrite); > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > mark_inode_dirty(inode); > inode_unlock(inode); > return len - towrite; > diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c > index 931e50018f88..8577ad494e05 100644 > --- a/fs/jfs/xattr.c > +++ b/fs/jfs/xattr.c > @@ -647,7 +647,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf, > if (old_blocks) > dquot_free_block(inode, old_blocks); > > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > > return 0; > } > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR