2023-06-21 14:57:26

by Jeff Layton

[permalink] [raw]
Subject: [PATCH 09/79] adfs: switch to new ctime accessors

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 <[email protected]>
---
fs/adfs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index c3ac613d0975..266191e6b80c 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -270,7 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
inode->i_mode = adfs_atts2mode(sb, inode);
adfs_adfs2unix_time(&inode->i_mtime, inode);
inode->i_atime = inode->i_mtime;
- inode->i_ctime = inode->i_mtime;
+ inode_ctime_set(inode, inode->i_mtime);

if (S_ISDIR(inode->i_mode)) {
inode->i_op = &adfs_dir_inode_operations;
@@ -331,7 +331,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
if (ia_valid & ATTR_ATIME)
inode->i_atime = attr->ia_atime;
if (ia_valid & ATTR_CTIME)
- inode->i_ctime = attr->ia_ctime;
+ inode_ctime_set(inode, attr->ia_ctime);
if (ia_valid & ATTR_MODE) {
ADFS_I(inode)->attr = adfs_mode2atts(sb, inode, attr->ia_mode);
inode->i_mode = adfs_atts2mode(sb, inode);
--
2.41.0



2023-06-21 16:52:34

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH 09/79] adfs: switch to new ctime accessors

On Wed 21-06-23 10:45:22, 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 <[email protected]>

Looks good to me. Feel free to add:

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

Honza

> ---
> fs/adfs/inode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
> index c3ac613d0975..266191e6b80c 100644
> --- a/fs/adfs/inode.c
> +++ b/fs/adfs/inode.c
> @@ -270,7 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
> inode->i_mode = adfs_atts2mode(sb, inode);
> adfs_adfs2unix_time(&inode->i_mtime, inode);
> inode->i_atime = inode->i_mtime;
> - inode->i_ctime = inode->i_mtime;
> + inode_ctime_set(inode, inode->i_mtime);
>
> if (S_ISDIR(inode->i_mode)) {
> inode->i_op = &adfs_dir_inode_operations;
> @@ -331,7 +331,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
> if (ia_valid & ATTR_ATIME)
> inode->i_atime = attr->ia_atime;
> if (ia_valid & ATTR_CTIME)
> - inode->i_ctime = attr->ia_ctime;
> + inode_ctime_set(inode, attr->ia_ctime);
> if (ia_valid & ATTR_MODE) {
> ADFS_I(inode)->attr = adfs_mode2atts(sb, inode, attr->ia_mode);
> inode->i_mode = adfs_atts2mode(sb, inode);
> --
> 2.41.0
>
--
Jan Kara <[email protected]>
SUSE Labs, CR