Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30295193rwd; Thu, 6 Jul 2023 04:00:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGnPz7J0QE9pu3gU/V71mJZ7wuYWJ/9oNQa62BXyEMKmu+pN19bACQeRtrHMIujQSqrzmn X-Received: by 2002:a05:6808:ece:b0:3a3:6450:f5c4 with SMTP id q14-20020a0568080ece00b003a36450f5c4mr1556971oiv.4.1688641230963; Thu, 06 Jul 2023 04:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688641230; cv=none; d=google.com; s=arc-20160816; b=dx5t1ehMsIfg3hjzMV2vxIERUVEC6dXJqHyquxapQMhUssbA4vLNx5Z5zh+BAGm8SI YfbD/PI/Lq5mGFlJRv3s0i1l+6lWs2FLbtqHT1Nle3sjLwHKQjkL7+jZdXSYSrpu9+AM Se4uB22wXwvs7v/xX0eO6Uq7vluB2hImYwRCtRKPWx9Rq8AjWuO0d2N9DzUDcFOg4qge UXQl3Km07E7aWbA/7IcVYXt/Aqd616pCXNnasYN6Nn/7JrA36aVdnxsDNSZLeWMEuM9g BrwdvDk42lwk+VCa06lMgfGWibZsKYrR58ZmevYQoKqjcE19PgFb422QVmq66PunPu5r NBCw== 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=B9t1yX8QtWH+Q8UoCt6rkOESZQWw8jliHIlvo7XWN7Q=; fh=bK1uIM0i1ABfZV891rJiz6w3x8BMcFqv3DZ1nDb/6dc=; b=GDMdWsxkQPNj4h1tY2SiwXBD48wWzafd5D+ZCVFj1mKKF5Jcuh1yOPwH/ZtLSGsZ4H a7PRcYX7NUdmYIzuLpLaHxWI2Gh0Ti/HhNSZNjD+rxD5g8jiH1INBQvQHqpa+D+yu14A 9vOZ10oJjsmr5peMDD5n8wJG4y6P6U5rzpvvhz1WTlVHlfvHmJ6quwEpEZTdZibosm9g aoEEVm9l4ndgJN67uf6DJwC1MLt5ggQ2i/NcHAeQhT2dpo21AI2sKqwyX1hOd58jYYWk dal4t08bX7SKn6mq1xMOM/qVSLCPATFmqKeP73um+R6uNP+7vS7+IWeHVbj4AvGdwLyO Cwpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JjaoaPL3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 cb4-20020a056a00430400b0063b1fbbb8c5si1186481pfb.131.2023.07.06.04.00.16; Thu, 06 Jul 2023 04:00:30 -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=JjaoaPL3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S231826AbjGFKov (ORCPT + 99 others); Thu, 6 Jul 2023 06:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjGFKot (ORCPT ); Thu, 6 Jul 2023 06:44:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA5B1BC2; Thu, 6 Jul 2023 03:44:48 -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 ED999229E6; Thu, 6 Jul 2023 10:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688640286; 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=B9t1yX8QtWH+Q8UoCt6rkOESZQWw8jliHIlvo7XWN7Q=; b=JjaoaPL3qffj88F1KesDyv91xqs+6qLDjhr515N9rL+h7IU0C0zmjbOFTOn0hAC8ltH4OJ OsevYl8nqhEE2AuWTCZX42mbdJS2BBzcFL8YifbJqD93FIxzg68gVNbfZFWXSLHUaWNuJx ab0XV8dh/mSXzFVpyw2iV8QokTkWf2w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688640286; 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=B9t1yX8QtWH+Q8UoCt6rkOESZQWw8jliHIlvo7XWN7Q=; b=6wnvT5/J5ovpk4p4zs560RCATS2EtWTQxu9QZ8KS308olyPVEJ/1piFaIid07SV+2B9lKt SqVe4Mv2MXtJnwCQ== 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 DDBF2138EE; Thu, 6 Jul 2023 10:44:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id FgQWNh6bpmT1fQAAMHmgww (envelope-from ); Thu, 06 Jul 2023 10:44:46 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 73C55A0707; Thu, 6 Jul 2023 12:44:46 +0200 (CEST) Date: Thu, 6 Jul 2023 12:44:46 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , "Tigran A. Aivazian" , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 28/92] bfs: convert to ctime accessor functions Message-ID: <20230706104446.gyx4d7msxoi5v377@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-26-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-26-jlayton@kernel.org> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,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:00:53, 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/bfs/dir.c | 16 ++++++++-------- > fs/bfs/inode.c | 5 ++--- > 2 files changed, 10 insertions(+), 11 deletions(-) > > diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c > index d2e8a2a56b05..12b8af04dcb3 100644 > --- a/fs/bfs/dir.c > +++ b/fs/bfs/dir.c > @@ -97,7 +97,7 @@ static int bfs_create(struct mnt_idmap *idmap, struct inode *dir, > set_bit(ino, info->si_imap); > info->si_freei--; > inode_init_owner(&nop_mnt_idmap, inode, dir, mode); > - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); > inode->i_blocks = 0; > inode->i_op = &bfs_file_inops; > inode->i_fop = &bfs_file_operations; > @@ -158,7 +158,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, > return err; > } > inc_nlink(inode); > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > mark_inode_dirty(inode); > ihold(inode); > d_instantiate(new, inode); > @@ -187,9 +187,9 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) > } > de->ino = 0; > mark_buffer_dirty_inode(bh, dir); > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > mark_inode_dirty(dir); > - inode->i_ctime = dir->i_ctime; > + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); > inode_dec_link_count(inode); > error = 0; > > @@ -240,10 +240,10 @@ static int bfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, > goto end_rename; > } > old_de->ino = 0; > - 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); > if (new_inode) { > - new_inode->i_ctime = current_time(new_inode); > + inode_set_ctime_current(new_inode); > inode_dec_link_count(new_inode); > } > mark_buffer_dirty_inode(old_bh, old_dir); > @@ -292,9 +292,9 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) > pos = (block - sblock) * BFS_BSIZE + off; > if (pos >= dir->i_size) { > dir->i_size += BFS_DIRENT_SIZE; > - dir->i_ctime = current_time(dir); > + inode_set_ctime_current(dir); > } > - dir->i_mtime = dir->i_ctime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > mark_inode_dirty(dir); > de->ino = cpu_to_le16((u16)ino); > for (i = 0; i < BFS_NAMELEN; i++) > diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c > index 1926bec2c850..e6a76ae9eb44 100644 > --- a/fs/bfs/inode.c > +++ b/fs/bfs/inode.c > @@ -82,10 +82,9 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) > inode->i_blocks = BFS_FILEBLOCKS(di); > inode->i_atime.tv_sec = le32_to_cpu(di->i_atime); > inode->i_mtime.tv_sec = le32_to_cpu(di->i_mtime); > - inode->i_ctime.tv_sec = le32_to_cpu(di->i_ctime); > + inode_set_ctime(inode, le32_to_cpu(di->i_ctime), 0); > inode->i_atime.tv_nsec = 0; > inode->i_mtime.tv_nsec = 0; > - inode->i_ctime.tv_nsec = 0; > > brelse(bh); > unlock_new_inode(inode); > @@ -143,7 +142,7 @@ static int bfs_write_inode(struct inode *inode, struct writeback_control *wbc) > di->i_nlink = cpu_to_le32(inode->i_nlink); > di->i_atime = cpu_to_le32(inode->i_atime.tv_sec); > di->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); > - di->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); > + di->i_ctime = cpu_to_le32(inode_get_ctime(inode).tv_sec); > i_sblock = BFS_I(inode)->i_sblock; > di->i_sblock = cpu_to_le32(i_sblock); > di->i_eblock = cpu_to_le32(BFS_I(inode)->i_eblock); > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR