[8924] in Athena Bugs
ctime for AFS files
daemon@ATHENA.MIT.EDU (John Carr)
Mon Feb 3 10:46:03 1992
To: bug-afs@Athena.MIT.EDU, bugs@Athena.MIT.EDU
Date: Mon, 03 Feb 92 10:45:42 EST
From: John Carr <jfc@Athena.MIT.EDU>
These changes make ctime work for AFS files.
*** /tmp/afs_cache.c.orig Mon Feb 3 10:38:40 1992
--- /tmp/afs_cache.c.jfc Mon Feb 3 10:38:12 1992
***************
*** 1401,1406 ****
--- 1393,1399 ----
* over a file being written.
*/
avc->m.Date = OutStatus.ClientModTime;
+ avc->m.ServerDate = OutStatus.ServerModTime;
}
else {
/* failure, set up to check with server next time */
***************
*** 1582,1588 ****
register long code, i;
register struct vcache *tvc;
- struct AFSVolSync tsync;
struct volume *tvp;
AFS_STATCNT(afs_StuffVcache);
--- 1575,1580 ----
***************
*** 2511,2516 ****
--- 2503,2509 ----
/* if writing the file, don't fetch over this value */
avc->m.Length = astat->Length;
avc->m.Date = astat->ClientModTime;
+ avc->m.ServerDate = astat->ServerModTime;
}
avc->m.Owner = astat->Owner;
avc->m.Group = astat->Group;
***************
*** 2556,2561 ****
--- 2549,2555 ----
/* if writing the file, don't fetch over these values */
avc->m.Length = astat->Length;
avc->m.Date = astat->ClientModTime;
+ avc->m.ServerDate = astat->ServerModTime;
}
avc->m.DataVersion = astat->DataVersion;
avc->m.Owner = astat->Owner;
***************
*** 3522,3528 ****
long newSize;
AFS_STATCNT(afs_TruncateAllSegments);
! avc->m.Date = osi_Time();
if (alen >= avc->m.Length) return 0;
#ifdef AFS_VFS40
--- 3490,3498 ----
long newSize;
AFS_STATCNT(afs_TruncateAllSegments);
! /* ServerDate isn't really the server time here; it is updated
! so it acts like UNIX ctime. */
! avc->m.ServerDate = avc->m.Date = osi_Time();
if (alen >= avc->m.Length) return 0;
#ifdef AFS_VFS40
*** /afs/athena.mit.edu/astaff/project/afsdev/src/3.1b/src/afs/afs.h Mon Nov 18 08:35:24 1991
--- afs.h Mon Feb 3 09:37:36 1992
***************
*** 330,336 ****
struct mstat {
long Length;
long DataVersion;
! long Date;
long Owner;
long Group;
short Mode;
--- 331,337 ----
struct mstat {
long Length;
long DataVersion;
! long Date, ServerDate;
long Owner;
long Group;
short Mode;
*** /afs/athena.mit.edu/astaff/project/afsdev/src/3.1b/src/afs/afs_vnodeops.c Tue Jan 28 06:21:58 1992
--- afs_vnodeops.c Mon Feb 3 09:42:27 1992
***************
*** 1116,1124 ****
int wroteLastByte;
long max;
register struct dcache *tdc;
- #ifdef _HIGHC_
- volatile
- #endif
long offset, len, error;
struct uio tuio;
struct iovec *tvec; /* again, should have define */
--- 927,932 ----
***************
*** 1892,1898 ****
attrs->va_nlink = avc->m.LinkCount;
attrs->va_size = avc->m.Length;
attrs->va_blocksize = 8192;
! attrs->va_atime.tv_sec = attrs->va_mtime.tv_sec = attrs->va_ctime.tv_sec = avc->m.Date;
/* set microseconds to be dataversion # so that we approximate NFS-style use of
* mtime as a dataversion #. We take it mod 512K because microseconds *must*
* be less than a million, and 512K is the biggest power of 2 less than such.
--- 1696,1703 ----
attrs->va_nlink = avc->m.LinkCount;
attrs->va_size = avc->m.Length;
attrs->va_blocksize = 8192;
! attrs->va_ctime.tv_sec = avc->m.ServerDate;
! attrs->va_atime.tv_sec = attrs->va_mtime.tv_sec = avc->m.Date;
/* set microseconds to be dataversion # so that we approximate NFS-style use of
* mtime as a dataversion #. We take it mod 512K because microseconds *must*
* be less than a million, and 512K is the biggest power of 2 less than such.
***************
*** 2742,2747 ****
--- 2494,2500 ----
avc->m.DataVersion = avers;
avc->m.Length = astat->Length;
avc->m.Date = astat->ClientModTime;
+ avc->m.ServerDate = astat->ServerModTime;
adc->flags |= DFEntryMod;
if (avers == adc->f.versionNo + aincr) {
/* we've been tracking things correctly */