Re: [PATCH v2 73/92] romfs: convert to ctime accessor functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 05-07-23 15:01:38, 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 <jlayton@xxxxxxxxxx>

> diff --git a/fs/romfs/super.c b/fs/romfs/super.c
> index c59b230d55b4..961b9d342e0e 100644
> --- a/fs/romfs/super.c
> +++ b/fs/romfs/super.c
> @@ -322,8 +322,8 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos)
>  
>  	set_nlink(i, 1);		/* Hard to decide.. */
>  	i->i_size = be32_to_cpu(ri.size);
> -	i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0;
> -	i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0;
> +	i->i_mtime.tv_sec = i->i_atime.tv_sec = inode_set_ctime(i, 0, 0).tv_sec;
> +	i->i_mtime.tv_nsec = i->i_atime.tv_nsec = 0;

The usual simplification:

	i->i_mtime = i->i_atime = inode_set_ctime(i, 0, 0);

								Honza
  
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux