afs: convert to ctime accessor functions
authorJeff Layton <jlayton@kernel.org>
Wed, 5 Jul 2023 19:00:49 +0000 (15:00 -0400)
committerChristian Brauner <brauner@kernel.org>
Thu, 13 Jul 2023 08:28:03 +0000 (10:28 +0200)
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.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-22-jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/afs/dynroot.c
fs/afs/inode.c

index d7d9402ff7182adfb702a4bc473ce0db3d3aa2ac..95bcbd7654d1b6f4cf602c7c6ee0143fa6840bc5 100644 (file)
@@ -88,7 +88,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root)
        set_nlink(inode, 2);
        inode->i_uid            = GLOBAL_ROOT_UID;
        inode->i_gid            = GLOBAL_ROOT_GID;
-       inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode);
+       inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
        inode->i_blocks         = 0;
        inode->i_generation     = 0;
 
index 866bab860a886df89a67f8143215800a996aabb1..6b636f43f5480ad9e14415acd034c57bcaf16b99 100644 (file)
@@ -90,7 +90,7 @@ static int afs_inode_init_from_status(struct afs_operation *op,
        vnode->status = *status;
 
        t = status->mtime_client;
-       inode->i_ctime = t;
+       inode_set_ctime_to_ts(inode, t);
        inode->i_mtime = t;
        inode->i_atime = t;
        inode->i_flags |= S_NOATIME;
@@ -206,7 +206,7 @@ static void afs_apply_status(struct afs_operation *op,
        t = status->mtime_client;
        inode->i_mtime = t;
        if (vp->update_ctime)
-               inode->i_ctime = op->ctime;
+               inode_set_ctime_to_ts(inode, op->ctime);
 
        if (vnode->status.data_version != status->data_version)
                data_changed = true;
@@ -252,7 +252,7 @@ static void afs_apply_status(struct afs_operation *op,
                vnode->netfs.remote_i_size = status->size;
                if (change_size) {
                        afs_set_i_size(vnode, status->size);
-                       inode->i_ctime = t;
+                       inode_set_ctime_to_ts(inode, t);
                        inode->i_atime = t;
                }
        }