From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39EC9EB64D9 for ; Thu, 6 Jul 2023 12:48:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbjGFMs0 (ORCPT ); Thu, 6 Jul 2023 08:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232095AbjGFMsJ (ORCPT ); Thu, 6 Jul 2023 08:48:09 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A7302113; Thu, 6 Jul 2023 05:47:45 -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 D415021C4E; Thu, 6 Jul 2023 12:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688647654; 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=nO7HoBp+tBDfiO8NyqBxFWNIdjOzmscimrRAo3po1O4=; b=n+Y6nDQXpv79YjzQkvXGkus7Qt0TtPVGo9RQs3l5LAwKX3w7PXijWXmIMgNXw02cjZsaFT GgbCr43AP+f5+JT+x2ryzTU5q+HVv9q6ANT4/O/FYRCqXkrRBqaDfcnGuz33puZbFB1iQf ZsU/sn57IVTgLisPwiA0ACfhP8T4UO4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688647654; 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=nO7HoBp+tBDfiO8NyqBxFWNIdjOzmscimrRAo3po1O4=; b=UcI+C+HTa4GWg8vtBITaev7k5cEqqqBCrt69ZHj8vo/Q+7kD8Kf/vTXM+5vpQs3nRqNzmg VPShQWuf2S+N8BCw== 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 C566C138FC; Thu, 6 Jul 2023 12:47:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HrQnMOa3pmToQQAAMHmgww (envelope-from ); Thu, 06 Jul 2023 12:47:34 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 63516A0707; Thu, 6 Jul 2023 14:47:34 +0200 (CEST) Date: Thu, 6 Jul 2023 14:47:34 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Mikulas Patocka , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 51/92] hpfs: convert to ctime accessor functions Message-ID: <20230706124734.ew57trrtzkegqg6y@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-49-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-49-jlayton@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05-07-23 15:01:16, 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 ... > diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c > index 69fb40b2c99a..36babb78b510 100644 > --- a/fs/hpfs/namei.c > +++ b/fs/hpfs/namei.c > @@ -13,10 +13,10 @@ static void hpfs_update_directory_times(struct inode *dir) > { > time64_t t = local_to_gmt(dir->i_sb, local_get_seconds(dir->i_sb)); > if (t == dir->i_mtime.tv_sec && > - t == dir->i_ctime.tv_sec) > + t == inode_get_ctime(dir).tv_sec) > return; > - dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; > - dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; > + dir->i_mtime.tv_sec = inode_set_ctime(dir, t, 0).tv_sec; > + dir->i_mtime.tv_nsec = 0; Easier to read: dir->i_mtime = inode_set_ctime(dir, t, 0); > @@ -59,8 +59,9 @@ static int hpfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, > result->i_ino = fno; > hpfs_i(result)->i_parent_dir = dir->i_ino; > hpfs_i(result)->i_dno = dno; > - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); > - result->i_ctime.tv_nsec = 0; > + inode_set_ctime(result, > + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), > + 0); > result->i_mtime.tv_nsec = 0; > result->i_atime.tv_nsec = 0; Here also: result->i_mtime = result->i_atime = inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0) > @@ -167,8 +168,9 @@ static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir, > result->i_fop = &hpfs_file_ops; > set_nlink(result, 1); > hpfs_i(result)->i_parent_dir = dir->i_ino; > - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); > - result->i_ctime.tv_nsec = 0; > + inode_set_ctime(result, > + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), > + 0); > result->i_mtime.tv_nsec = 0; > result->i_atime.tv_nsec = 0; And here exactly the same. > @@ -250,8 +252,9 @@ static int hpfs_mknod(struct mnt_idmap *idmap, struct inode *dir, > hpfs_init_inode(result); > result->i_ino = fno; > hpfs_i(result)->i_parent_dir = dir->i_ino; > - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); > - result->i_ctime.tv_nsec = 0; > + inode_set_ctime(result, > + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), > + 0); > result->i_mtime.tv_nsec = 0; > result->i_atime.tv_nsec = 0; > hpfs_i(result)->i_ea_size = 0; > @@ -326,8 +329,9 @@ static int hpfs_symlink(struct mnt_idmap *idmap, struct inode *dir, > result->i_ino = fno; > hpfs_init_inode(result); > hpfs_i(result)->i_parent_dir = dir->i_ino; > - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); > - result->i_ctime.tv_nsec = 0; > + inode_set_ctime(result, > + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), > + 0); > result->i_mtime.tv_nsec = 0; > result->i_atime.tv_nsec = 0; > hpfs_i(result)->i_ea_size = 0; And in above two as well. Honza -- Jan Kara SUSE Labs, CR