[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230621164808.5lhujni7qb36hhtk@quack3>
Date: Wed, 21 Jun 2023 18:48:08 +0200
From: Jan Kara <jack@...e.cz>
To: Jeff Layton <jlayton@...nel.org>
Cc: Christian Brauner <brauner@...nel.org>,
"Tigran A. Aivazian" <aivazian.tigran@...il.com>,
Al Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/79] bfs: switch to new ctime accessors
On Wed 21-06-23 10:45:28, Jeff Layton wrote:
> In later patches, we're going to change how the ctime.tv_nsec field is
> utilized. Switch to using accessor functions instead of raw accesses of
> inode->i_ctime.
>
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
...
> diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
> index 1926bec2c850..c964316be32b 100644
> --- a/fs/bfs/inode.c
> +++ b/fs/bfs/inode.c
> @@ -82,10 +82,10 @@ 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_ctime_set_sec(inode, le32_to_cpu(di->i_ctime));
> inode->i_atime.tv_nsec = 0;
> inode->i_mtime.tv_nsec = 0;
> - inode->i_ctime.tv_nsec = 0;
> + inode_ctime_set_nsec(inode, 0);
So I'm somewhat wondering here - in other filesystem you construct
timespec64 and then use inode_ctime_set(). Here you use
inode_ctime_set_sec() + inode_ctime_set_nsec(). What's the benefit? It
seems these two functions are not used that much some maybe we could just
live with just inode_ctime_set() and constructing timespec64 when needed?
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists