[PATCH v2 39/92] erofs: convert to ctime accessor functions
Gao Xiang
hsiangkao at linux.alibaba.com
Fri Jul 7 01:12:37 AEST 2023
Hi Jan,
On 2023/7/6 19:00, Jan Kara wrote:
> On Wed 05-07-23 15:01:04, 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.
>>
>> Acked-by: Gao Xiang <xiang at kernel.org>
>> Signed-off-by: Jeff Layton <jlayton at kernel.org>
>
> Just one nit below:
>
>> @@ -176,10 +175,10 @@ static void *erofs_read_inode(struct erofs_buf *buf,
>> vi->chunkbits = sb->s_blocksize_bits +
>> (vi->chunkformat & EROFS_CHUNK_FORMAT_BLKBITS_MASK);
>> }
>> - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec;
>> - inode->i_atime.tv_sec = inode->i_ctime.tv_sec;
>> - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec;
>> - inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec;
>> + inode->i_mtime.tv_sec = inode_get_ctime(inode).tv_sec;
>> + inode->i_atime.tv_sec = inode_get_ctime(inode).tv_sec;
>> + inode->i_mtime.tv_nsec = inode_get_ctime(inode).tv_nsec;
>> + inode->i_atime.tv_nsec = inode_get_ctime(inode).tv_nsec;
>
> Isn't this just longer way to write:
>
> inode->i_atime = inode->i_mtime = inode_get_ctime(inode);
I'm fine with this. I think we could use this (although I'm not sure
if checkpatch will complain but personally I'm fine.)
Thanks,
Gao Xiang
>
> ?
>
> Honza
More information about the Linux-erofs
mailing list