[PATCH 53/79] orangefs: switch to new ctime accessors

From: Jeff Layton
Date: Wed Jun 21 2023 - 10:53:11 EST


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 <jlayton@xxxxxxxxxx>
---
fs/orangefs/namei.c | 2 +-
fs/orangefs/orangefs-utils.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
index 77518e248cf7..14085537ba1c 100644
--- a/fs/orangefs/namei.c
+++ b/fs/orangefs/namei.c
@@ -421,7 +421,7 @@ static int orangefs_rename(struct mnt_idmap *idmap,
ret);

if (new_dentry->d_inode)
- new_dentry->d_inode->i_ctime = current_time(new_dentry->d_inode);
+ inode_ctime_set_current(new_dentry->d_inode);

op_release(new_op);
return ret;
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 46b7dcff18ac..4d12efb2ee85 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -361,11 +361,11 @@ int orangefs_inode_getattr(struct inode *inode, int flags)
downcall.resp.getattr.attributes.atime;
inode->i_mtime.tv_sec = (time64_t)new_op->
downcall.resp.getattr.attributes.mtime;
- inode->i_ctime.tv_sec = (time64_t)new_op->
- downcall.resp.getattr.attributes.ctime;
+ inode_ctime_set_sec(inode,
+ (time64_t)new_op->downcall.resp.getattr.attributes.ctime);
inode->i_atime.tv_nsec = 0;
inode->i_mtime.tv_nsec = 0;
- inode->i_ctime.tv_nsec = 0;
+ inode_ctime_set_nsec(inode, 0);

/* special case: mark the root inode as sticky */
inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) |
--
2.41.0