Skip to content

Commit

Permalink
fs: rename inode i_atime and i_mtime fields
Browse files Browse the repository at this point in the history
Rename these two fields to discourage direct access (and to help ensure
that we mop up any leftover direct accesses).

Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
jtlayton authored and brauner committed Oct 18, 2023
1 parent d32cdb3 commit 12cd440
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,8 @@ struct inode {
};
dev_t i_rdev;
loff_t i_size;
struct timespec64 i_atime;
struct timespec64 i_mtime;
struct timespec64 __i_atime;
struct timespec64 __i_mtime;
struct timespec64 __i_ctime; /* use inode_*_ctime accessors! */
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
unsigned short i_bytes;
Expand Down Expand Up @@ -1513,23 +1513,23 @@ struct timespec64 inode_set_ctime_current(struct inode *inode);

static inline time64_t inode_get_atime_sec(const struct inode *inode)
{
return inode->i_atime.tv_sec;
return inode->__i_atime.tv_sec;
}

static inline long inode_get_atime_nsec(const struct inode *inode)
{
return inode->i_atime.tv_nsec;
return inode->__i_atime.tv_nsec;
}

static inline struct timespec64 inode_get_atime(const struct inode *inode)
{
return inode->i_atime;
return inode->__i_atime;
}

static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode,
struct timespec64 ts)
{
inode->i_atime = ts;
inode->__i_atime = ts;
return ts;
}

Expand All @@ -1543,23 +1543,23 @@ static inline struct timespec64 inode_set_atime(struct inode *inode,

static inline time64_t inode_get_mtime_sec(const struct inode *inode)
{
return inode->i_mtime.tv_sec;
return inode->__i_mtime.tv_sec;
}

static inline long inode_get_mtime_nsec(const struct inode *inode)
{
return inode->i_mtime.tv_nsec;
return inode->__i_mtime.tv_nsec;
}

static inline struct timespec64 inode_get_mtime(const struct inode *inode)
{
return inode->i_mtime;
return inode->__i_mtime;
}

static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode,
struct timespec64 ts)
{
inode->i_mtime = ts;
inode->__i_mtime = ts;
return ts;
}

Expand Down

0 comments on commit 12cd440

Please sign in to comment.