Commit 26a8cfd8 authored by Stephen Lord's avatar Stephen Lord Committed by Nathan Scott

[XFS] optimize timestamp updates, use new hires timestamps more directly,

also fix a bug where the mtime field was not correctly updated.

SGI Modid: 2.5.x-xfs:slinx:142296a
parent 20ac875e
......@@ -200,7 +200,7 @@ vn_revalidate(
vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address);
ASSERT(vp->v_fbhv != NULL);
va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT;
va.va_mask = XFS_AT_STAT;
VOP_GETATTR(vp, &va, 0, NULL, error);
if (!error) {
inode = LINVFS_GET_IP(vp);
......@@ -210,12 +210,9 @@ vn_revalidate(
inode->i_gid = va.va_gid;
inode->i_size = va.va_size;
inode->i_blocks = va.va_nblocks;
inode->i_mtime.tv_sec = va.va_mtime.tv_sec;
inode->i_mtime.tv_nsec = va.va_mtime.tv_nsec;
inode->i_ctime.tv_sec = va.va_ctime.tv_sec;
inode->i_ctime.tv_nsec = va.va_ctime.tv_nsec;
inode->i_atime.tv_sec = va.va_atime.tv_sec;
inode->i_atime.tv_nsec = va.va_atime.tv_nsec;
inode->i_mtime = va.va_mtime;
inode->i_ctime = va.va_ctime;
inode->i_atime = va.va_atime;
VUNMODIFY(vp);
}
return -error;
......
......@@ -45,11 +45,7 @@ static inline void delay(long ticks)
static inline void nanotime(struct timespec *tvp)
{
struct timeval tv;
do_gettimeofday(&tv);
tvp->tv_sec = tv.tv_sec;
tvp->tv_nsec = tv.tv_usec * 1000;
*tvp = CURRENT_TIME;
}
#endif /* __XFS_SUPPORT_TIME_H__ */
......@@ -3580,16 +3580,19 @@ xfs_ichgtime(xfs_inode_t *ip,
nanotime(&tv);
if (flags & XFS_ICHGTIME_MOD) {
inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
inode->i_mtime = tv;
ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
}
if (flags & XFS_ICHGTIME_ACC) {
inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec;
inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec;
inode->i_atime = tv;
ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec;
}
if (flags & XFS_ICHGTIME_CHG) {
inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
inode->i_ctime = tv;
ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment