mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-19 05:36:44 +00:00
Use a/m/c_time accessor functions
In v6.6-rc5-1-g077c212f0344, one can no longer directly access the inode m_time and a_time etc. We have to go through these static inline functions to get to them. Further back, ctime accessors were added in v6.5-rc1-7-g9b6304c1d537, and need to be applied as well. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -211,6 +211,101 @@ unsigned long kc_list_lru_shrink_walk(struct list_lru *lru, struct shrink_contro
|
||||
#define get_random_u32_below prandom_u32_max
|
||||
#endif
|
||||
|
||||
#ifndef KC_FS_INODE_C_TIME_ACCESSOR
|
||||
struct timespec64 inode_set_ctime_current(struct inode *inode);
|
||||
static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode,
|
||||
struct timespec64 ts)
|
||||
{
|
||||
inode->i_ctime.tv_sec = ts.tv_sec;
|
||||
inode->i_ctime.tv_nsec = ts.tv_nsec;
|
||||
return ts;
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_set_ctime(struct inode *inode,
|
||||
time64_t sec, long nsec)
|
||||
{
|
||||
struct timespec64 ts = { .tv_sec = sec,
|
||||
.tv_nsec = nsec };
|
||||
|
||||
return inode_set_ctime_to_ts(inode, ts);
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_get_ctime(const struct inode *inode)
|
||||
{
|
||||
struct timespec64 ts = { .tv_sec = inode->i_ctime.tv_sec,
|
||||
.tv_nsec = inode->i_ctime.tv_nsec };
|
||||
return ts;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef KC_FS_INODE_AM_TIME_ACCESSOR
|
||||
static inline struct timespec64 inode_get_mtime(const struct inode *inode)
|
||||
{
|
||||
struct timespec64 ts = { .tv_sec = inode->i_mtime.tv_sec,
|
||||
.tv_nsec = inode->i_mtime.tv_nsec };
|
||||
return ts;
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode,
|
||||
struct timespec64 ts)
|
||||
{
|
||||
inode->i_mtime.tv_sec = ts.tv_sec;
|
||||
inode->i_mtime.tv_nsec = ts.tv_nsec;
|
||||
return ts;
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_set_mtime(struct inode *inode,
|
||||
time64_t sec, long nsec)
|
||||
{
|
||||
struct timespec64 ts = { .tv_sec = sec,
|
||||
.tv_nsec = nsec };
|
||||
|
||||
return inode_set_mtime_to_ts(inode, ts);
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode,
|
||||
struct timespec64 ts)
|
||||
{
|
||||
inode->i_atime.tv_sec = ts.tv_sec;
|
||||
inode->i_atime.tv_nsec = ts.tv_nsec;
|
||||
return ts;
|
||||
}
|
||||
|
||||
static inline struct timespec64 inode_set_atime(struct inode *inode,
|
||||
time64_t sec, long nsec)
|
||||
{
|
||||
struct timespec64 ts = { .tv_sec = sec,
|
||||
.tv_nsec = nsec };
|
||||
|
||||
return inode_set_atime_to_ts(inode, ts);
|
||||
}
|
||||
|
||||
static inline time64_t inode_get_ctime_sec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_ctime.tv_sec;
|
||||
}
|
||||
static inline long inode_get_ctime_nsec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_ctime.tv_nsec;
|
||||
}
|
||||
static inline time64_t inode_get_mtime_sec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_mtime.tv_sec;
|
||||
}
|
||||
static inline long inode_get_mtime_nsec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_mtime.tv_nsec;
|
||||
}
|
||||
static inline time64_t inode_get_atime_sec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_atime.tv_sec;
|
||||
}
|
||||
static inline long inode_get_atime_nsec(const struct inode *inode)
|
||||
{
|
||||
return inode->i_atime.tv_nsec;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef KC_TIMER_CONTAINER_OF
|
||||
#define timer_container_of(var, callback_timer, timer_fieldname) \
|
||||
from_timer(var, callback_timer, timer_fieldname)
|
||||
|
||||
Reference in New Issue
Block a user