Re: [PATCH v2 92/92] fs: rename i_ctime field to __i_ctime

Jan Kara <[email protected]>
Newsgroups gmane.comp.file-systems.reiserfs.general,gmane.linux.ports.ppc64.devel,gmane.linux.kernel,gmane.linux.drivers.rdma,gmane.linux.usb.general,gmane.linux.file-systems,gmane.linux.kernel.autofs,gmane.linux.kernel.mm,gmane.comp.file-systems.btrfs,gmane.comp.file-systems.ceph.devel,gmane.comp.file-systems.coda.general,gmane.comp.file-systems.ecryptfs.general,gmane.linux.kernel.efi,gmane.comp.file-systems.ext4,gmane.linux.file-systems.f2fs,gmane.linux.cluster.redhat.cluster.devel,gmane.linux.uml.devel,gmane.linux.drivers.mtd,gmane.linux.nfs,gmane.comp.file-systems.nilfs.user,gmane.linux.file-systems.ntfs.devel,gmane.linux.hardware.karma.devel,gmane.linux.file-systems.union,gmane.linux.kernel.cifs,gmane.network.samba.internals,gmane.linux.kernel.bpf,gmane.linux.network,gmane.comp.security.apparmor,gmane.linux.kernel.lsm
Message-ID <20230706145831.iwmb7c3jerbkctda@quack3>
On Wed 05-07-23 14:58:12, Jeff Layton wrote:
> Now that everything in-tree is converted to use the accessor functions,
> rename the i_ctime field in the inode to discourage direct access.
> 
> Signed-off-by: Jeff Layton <[email protected]>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

								Honza

> ---
>  include/linux/fs.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 14e38bd900f1..b66442f91835 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -642,7 +642,7 @@ struct inode {
>  	loff_t			i_size;
>  	struct timespec64	i_atime;
>  	struct timespec64	i_mtime;
> -	struct timespec64	i_ctime;
> +	struct timespec64	__i_ctime; /* use inode_*_ctime accessors! */
>  	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */
>  	unsigned short          i_bytes;
>  	u8			i_blkbits;
> @@ -1485,7 +1485,7 @@ struct timespec64 inode_set_ctime_current(struct inode *inode);
>   */
>  static inline struct timespec64 inode_get_ctime(const struct inode *inode)
>  {
> -	return inode->i_ctime;
> +	return inode->__i_ctime;
>  }
>  
>  /**
> @@ -1498,7 +1498,7 @@ static inline struct timespec64 inode_get_ctime(const struct inode *inode)
>  static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode,
>  						      struct timespec64 ts)
>  {
> -	inode->i_ctime = ts;
> +	inode->__i_ctime = ts;
>  	return ts;
>  }
>  
> -- 
> 2.41.0
> 
-- 
Jan Kara <[email protected]>
SUSE Labs, CR
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.