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

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Message-Id: <20230705190309.579783-29-jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/coda/coda_linux.c
fs/coda/dir.c
fs/coda/file.c
fs/coda/inode.c

index 903ca8fa4b9b87a74c2b73b0a11fe3b221508366..ae023853a98f1c97bf5371e0de9f2da8c5f3c1ed 100644 (file)
@@ -127,7 +127,8 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr)
        if (attr->va_mtime.tv_sec != -1)
                inode->i_mtime = coda_to_timespec64(attr->va_mtime);
         if (attr->va_ctime.tv_sec != -1)
-               inode->i_ctime = coda_to_timespec64(attr->va_ctime);
+               inode_set_ctime_to_ts(inode,
+                                     coda_to_timespec64(attr->va_ctime));
 }
 
 
index 8450b1bd354b1b2cfa00817f91cc8d83578354c9..1d4f40048efc591cbcdc79eecbaac43842eb8269 100644 (file)
@@ -111,7 +111,7 @@ static inline void coda_dir_update_mtime(struct inode *dir)
        /* optimistically we can also act as if our nose bleeds. The
         * granularity of the mtime is coarse anyways so we might actually be
         * right most of the time. Note: we only do this for directories. */
-       dir->i_mtime = dir->i_ctime = current_time(dir);
+       dir->i_mtime = inode_set_ctime_current(dir);
 #endif
 }
 
index 12b26bd13564d9bcce8e065a705053d2690c29ea..42346618b4ed192d0c62d268ab52b941fd204706 100644 (file)
@@ -84,7 +84,7 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to)
        ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, 0);
        coda_inode->i_size = file_inode(host_file)->i_size;
        coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9;
-       coda_inode->i_mtime = coda_inode->i_ctime = current_time(coda_inode);
+       coda_inode->i_mtime = inode_set_ctime_current(coda_inode);
        inode_unlock(coda_inode);
        file_end_write(host_file);
 
index d661e6cf17acdbe6a7b9a86658e62e038fc19876..3e64679c162082ddd23f079cc90c0cece836e0bd 100644 (file)
@@ -269,7 +269,7 @@ int coda_setattr(struct mnt_idmap *idmap, struct dentry *de,
 
        memset(&vattr, 0, sizeof(vattr)); 
 
-       inode->i_ctime = current_time(inode);
+       inode_set_ctime_current(inode);
        coda_iattr_to_vattr(iattr, &vattr);
        vattr.va_type = C_VNON; /* cannot set type */