Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30449831rwd; Thu, 6 Jul 2023 06:11:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlFAOafn+9BeiRR8JB383U5UnJGwzuGGqWGp28j37rv0fBizGJwwSW5OxpXjE3+7AMJyQmlY X-Received: by 2002:a17:903:25d3:b0:1b8:c6:ec8f with SMTP id jc19-20020a17090325d300b001b800c6ec8fmr1302193plb.46.1688649112233; Thu, 06 Jul 2023 06:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688649112; cv=none; d=google.com; s=arc-20160816; b=CFIGx8UBqT5nSPvt3pZJ+v/djwtxZgMa50xuTbgLyjqcA2k3iBCR4NhyZT8MPSynv3 woC5KbjJaC8yiIdflpluIn/5pnreTV5aHBDx6FilOLfQTfzCKVdfwHmaZua9gn5EXBBe YyNmvFSKlos/5NPQDafe2jRdURC5CRzVGs3itI8j6QREQFe4b1By9IJxAFCy344vHuBN H2rEy7JaRLeKt3U0TAbh/kftCNjStrCelQq/9OqLcHrsGP7CKj54iVms1AbsQfotl8ox zA+meXZbJr4I804UZfseEGi0sQUWu2lI278kTS2fUtIgU8t1UKVJLLbUxn0LB2lqrYqt iIOg== 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=m0tmldPz0+dDTJ2s0T/DzEzZUGUbqrRg9hgSmSJ6FUs=; fh=gV9+57YtZieAXZnRukJ+0BOiemj3O5p/k5CdTdrYCJ4=; b=YK57bXMENLseZ+Qz4mAuFS3WeDSk8DZwzbE3wjPrWsxxRlq3H+7ezkIQlLic5jpEng pkQtbIZWNvf+YJO1+Hf2RBGtmPSTCYkWdDIqcCHC8zNaN1NOoR9x5PmqrClO7Im0Uu/C BpZMMV5gKfqVmCa0a1qw5NIFim4HBWj40wBR1Rg5/EszvKLzSs5AF9bOwUzKz6uegGTM cI9KEWuf6Vza2+8jxb+pelcx324JR5IGJnl+I1IfgFaWPCiUrulyaYvYN48MSzxi4SDO Joo5vVUzx+5bQ5WJKZHEQcB1kb4j3nXOUZFdr28k0i3SnD31dvbxaPCw7uepL47B0MyT rJ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="t/K5Cbfj"; dkim=neutral (no key) header.i=@suse.cz; 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 q16-20020a17090311d000b001b87d0de22esi1382340plh.593.2023.07.06.06.11.39; Thu, 06 Jul 2023 06:11:52 -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="t/K5Cbfj"; dkim=neutral (no key) header.i=@suse.cz; 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 S232533AbjGFMvM (ORCPT + 99 others); Thu, 6 Jul 2023 08:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbjGFMvJ (ORCPT ); Thu, 6 Jul 2023 08:51:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C14411BDC; Thu, 6 Jul 2023 05:50:46 -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 805101FE6D; Thu, 6 Jul 2023 12:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688647845; 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=m0tmldPz0+dDTJ2s0T/DzEzZUGUbqrRg9hgSmSJ6FUs=; b=t/K5CbfjbtMsIk0e2qX/C9kdtDTiaTsp6pSw/9TNgEllEgBlWL+vK6JKTb0yWMjD0riYgJ 9MaHIHPgD+UXb4bxvDDrTEqVHZ+bUxxvOYQ3+CShw6Eb5n4u1xetjmrlvR1QwhC0gCxB+l vnjE0qS2eIV5HBceEmYUwqs4jY4Gkmo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688647845; 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=m0tmldPz0+dDTJ2s0T/DzEzZUGUbqrRg9hgSmSJ6FUs=; b=+uUJJQHKLUNtq0CM9IqsZNdKDm3jMq+Vqoau3+T9Lf8zrg4rAf7woCOYryWSkhKgj0s5dP ve+ojBv9a2EDUxAA== 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 5A0EB138FC; Thu, 6 Jul 2023 12:50:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Wj/FaW4pmTBQwAAMHmgww (envelope-from ); Thu, 06 Jul 2023 12:50:45 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id DAF8BA0707; Thu, 6 Jul 2023 14:50:44 +0200 (CEST) Date: Thu, 6 Jul 2023 14:50:44 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 48/92] hfs: convert to ctime accessor functions Message-ID: <20230706125044.yuder555eqh3acjx@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-46-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-46-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:13, 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/hfs/catalog.c | 8 ++++---- > fs/hfs/dir.c | 2 +- > fs/hfs/inode.c | 13 ++++++------- > fs/hfs/sysdep.c | 4 +++- > 4 files changed, 14 insertions(+), 13 deletions(-) > > diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c > index d365bf0b8c77..632c226a3972 100644 > --- a/fs/hfs/catalog.c > +++ b/fs/hfs/catalog.c > @@ -133,7 +133,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i > goto err1; > > dir->i_size++; > - dir->i_mtime = dir->i_ctime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > mark_inode_dirty(dir); > hfs_find_exit(&fd); > return 0; > @@ -269,7 +269,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str) > } > > dir->i_size--; > - dir->i_mtime = dir->i_ctime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > mark_inode_dirty(dir); > res = 0; > out: > @@ -337,7 +337,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, > if (err) > goto out; > dst_dir->i_size++; > - dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); > + dst_dir->i_mtime = inode_set_ctime_current(dst_dir); > mark_inode_dirty(dst_dir); > > /* finally remove the old entry */ > @@ -349,7 +349,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, > if (err) > goto out; > src_dir->i_size--; > - src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); > + src_dir->i_mtime = inode_set_ctime_current(src_dir); > mark_inode_dirty(src_dir); > > type = entry.type; > diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c > index 3e1e3dcf0b48..b75c26045df4 100644 > --- a/fs/hfs/dir.c > +++ b/fs/hfs/dir.c > @@ -263,7 +263,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry) > if (res) > return res; > clear_nlink(inode); > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > hfs_delete_inode(inode); > mark_inode_dirty(inode); > return 0; > diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c > index 441d7fc952e3..ee349b72cfb3 100644 > --- a/fs/hfs/inode.c > +++ b/fs/hfs/inode.c > @@ -200,7 +200,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t > inode->i_uid = current_fsuid(); > inode->i_gid = current_fsgid(); > set_nlink(inode, 1); > - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); > HFS_I(inode)->flags = 0; > HFS_I(inode)->rsrc_inode = NULL; > HFS_I(inode)->fs_blocks = 0; > @@ -355,8 +355,8 @@ static int hfs_read_inode(struct inode *inode, void *data) > inode->i_mode |= S_IWUGO; > inode->i_mode &= ~hsb->s_file_umask; > inode->i_mode |= S_IFREG; > - inode->i_ctime = inode->i_atime = inode->i_mtime = > - hfs_m_to_utime(rec->file.MdDat); > + inode->i_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, > + hfs_m_to_utime(rec->file.MdDat)); > inode->i_op = &hfs_file_inode_operations; > inode->i_fop = &hfs_file_operations; > inode->i_mapping->a_ops = &hfs_aops; > @@ -366,8 +366,8 @@ static int hfs_read_inode(struct inode *inode, void *data) > inode->i_size = be16_to_cpu(rec->dir.Val) + 2; > HFS_I(inode)->fs_blocks = 0; > inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); > - inode->i_ctime = inode->i_atime = inode->i_mtime = > - hfs_m_to_utime(rec->dir.MdDat); > + inode->i_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, > + hfs_m_to_utime(rec->dir.MdDat)); > inode->i_op = &hfs_dir_inode_operations; > inode->i_fop = &hfs_dir_operations; > break; > @@ -654,8 +654,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, > > truncate_setsize(inode, attr->ia_size); > hfs_file_truncate(inode); > - inode->i_atime = inode->i_mtime = inode->i_ctime = > - current_time(inode); > + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); > } > > setattr_copy(&nop_mnt_idmap, inode, attr); > diff --git a/fs/hfs/sysdep.c b/fs/hfs/sysdep.c > index 2875961fdc10..dc27d418fbcd 100644 > --- a/fs/hfs/sysdep.c > +++ b/fs/hfs/sysdep.c > @@ -28,7 +28,9 @@ static int hfs_revalidate_dentry(struct dentry *dentry, unsigned int flags) > /* fix up inode on a timezone change */ > diff = sys_tz.tz_minuteswest * 60 - HFS_I(inode)->tz_secondswest; > if (diff) { > - inode->i_ctime.tv_sec += diff; > + struct timespec64 ctime = inode_get_ctime(inode); > + > + inode_set_ctime(inode, ctime.tv_sec + diff, ctime.tv_nsec); > inode->i_atime.tv_sec += diff; > inode->i_mtime.tv_sec += diff; > HFS_I(inode)->tz_secondswest += diff; > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR