In sys/time.h, struct timespec is defined as:

/*
         * Structure defined by POSIX.4 to be like a timeval.
         */
        struct timespec {
                time_t  ts_sec;         /* seconds */
                long    ts_nsec;        /* and nanoseconds */
        };

        The correct names of the fields are tv_sec and tv_nsec.

Reminded by:	James Drobina <jdrobina@infinet.com>
This commit is contained in:
Nate Williams 1996-09-19 18:21:32 +00:00
parent a43a248c32
commit 030e2e9ebb
31 changed files with 199 additions and 199 deletions

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_conv.c,v 1.8 1996/04/05 16:31:49 ache Exp $ */
/* $Id: msdosfs_conv.c,v 1.9 1996/04/05 18:59:06 ache Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.6.2.1 1994/08/30 02:27:57 cgd Exp $ */
/*
@ -77,7 +77,7 @@ unix2dostime(tsp, ddp, dtp)
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
t = tsp->ts_sec - (tz.tz_minuteswest * 60)
t = tsp->tv_sec - (tz.tz_minuteswest * 60)
- (wall_cmos_clock ? adjkerntz : 0);
/* - daylight savings time correction */
if (lasttime != t) {
@ -175,10 +175,10 @@ dos2unixtime(dd, dt, tsp)
days += ((dd & DD_DAY_MASK) >> DD_DAY_SHIFT) - 1;
lastseconds = (days * 24 * 60 * 60) + SECONDSTO1980;
}
tsp->ts_sec = seconds + lastseconds + (tz.tz_minuteswest * 60)
tsp->tv_sec = seconds + lastseconds + (tz.tz_minuteswest * 60)
+ adjkerntz;
/* + daylight savings time correction */
tsp->ts_nsec = 0;
tsp->tv_nsec = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vnops.c,v 1.31 1996/06/14 11:01:41 asami Exp $ */
/* $Id: msdosfs_vnops.c,v 1.32 1996/09/03 14:23:33 bde Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
/*-
@ -464,7 +464,7 @@ msdosfs_setattr(ap)
if (error)
return error;
}
if (vap->va_mtime.ts_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != dep->de_pmp->pm_uid &&

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)inode.h 8.4 (Berkeley) 1/21/94
* $Id: inode.h,v 1.7 1995/11/05 23:35:56 dyson Exp $
* $Id: inode.h,v 1.8 1996/01/30 23:02:15 mpp Exp $
*/
#ifndef _UFS_UFS_INODE_H_
@ -155,15 +155,15 @@ struct indir {
if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
(ip)->i_flag |= IN_MODIFIED; \
if ((ip)->i_flag & IN_ACCESS) \
(ip)->i_atime.ts_sec \
(ip)->i_atime.tv_sec \
= ((t1) == &time ? tv_sec : (t1)->tv_sec); \
if ((ip)->i_flag & IN_UPDATE) { \
(ip)->i_mtime.ts_sec \
(ip)->i_mtime.tv_sec \
= ((t2) == &time ? tv_sec : (t2)->tv_sec); \
(ip)->i_modrev++; \
} \
if ((ip)->i_flag & IN_CHANGE) \
(ip)->i_ctime.ts_sec = tv_sec; \
(ip)->i_ctime.tv_sec = tv_sec; \
(ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
} \
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)inode.h 8.4 (Berkeley) 1/21/94
* $Id: inode.h,v 1.7 1995/11/05 23:35:56 dyson Exp $
* $Id: inode.h,v 1.8 1996/01/30 23:02:15 mpp Exp $
*/
#ifndef _UFS_UFS_INODE_H_
@ -155,15 +155,15 @@ struct indir {
if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
(ip)->i_flag |= IN_MODIFIED; \
if ((ip)->i_flag & IN_ACCESS) \
(ip)->i_atime.ts_sec \
(ip)->i_atime.tv_sec \
= ((t1) == &time ? tv_sec : (t1)->tv_sec); \
if ((ip)->i_flag & IN_UPDATE) { \
(ip)->i_mtime.ts_sec \
(ip)->i_mtime.tv_sec \
= ((t2) == &time ? tv_sec : (t2)->tv_sec); \
(ip)->i_modrev++; \
} \
if ((ip)->i_flag & IN_CHANGE) \
(ip)->i_ctime.ts_sec = tv_sec; \
(ip)->i_ctime.tv_sec = tv_sec; \
(ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
} \
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
* $Id: vfs_subr.c,v 1.58 1996/08/15 06:45:01 dyson Exp $
* $Id: vfs_subr.c,v 1.59 1996/08/21 21:55:21 dyson Exp $
*/
/*
@ -318,9 +318,9 @@ vattr_null(vap)
vap->va_mode = vap->va_nlink = vap->va_uid = vap->va_gid =
vap->va_fsid = vap->va_fileid =
vap->va_blocksize = vap->va_rdev =
vap->va_atime.ts_sec = vap->va_atime.ts_nsec =
vap->va_mtime.ts_sec = vap->va_mtime.ts_nsec =
vap->va_ctime.ts_sec = vap->va_ctime.ts_nsec =
vap->va_atime.tv_sec = vap->va_atime.tv_nsec =
vap->va_mtime.tv_sec = vap->va_mtime.tv_nsec =
vap->va_ctime.tv_sec = vap->va_ctime.tv_nsec =
vap->va_flags = vap->va_gen = VNOVAL;
vap->va_vaflags = 0;
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.49 1996/09/03 07:09:03 davidg Exp $
* $Id: vfs_syscalls.c,v 1.50 1996/09/03 14:21:53 bde Exp $
*/
/*
@ -1693,10 +1693,10 @@ utimes(p, uap, retval)
vp = nd.ni_vp;
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
VOP_LOCK(vp);
vattr.va_atime.ts_sec = tv[0].tv_sec;
vattr.va_atime.ts_nsec = tv[0].tv_usec * 1000;
vattr.va_mtime.ts_sec = tv[1].tv_sec;
vattr.va_mtime.ts_nsec = tv[1].tv_usec * 1000;
vattr.va_atime.tv_sec = tv[0].tv_sec;
vattr.va_atime.tv_nsec = tv[0].tv_usec * 1000;
vattr.va_mtime.tv_sec = tv[1].tv_sec;
vattr.va_mtime.tv_nsec = tv[1].tv_usec * 1000;
error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
vput(vp);
return (error);

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
* $Id: vfs_subr.c,v 1.58 1996/08/15 06:45:01 dyson Exp $
* $Id: vfs_subr.c,v 1.59 1996/08/21 21:55:21 dyson Exp $
*/
/*
@ -318,9 +318,9 @@ vattr_null(vap)
vap->va_mode = vap->va_nlink = vap->va_uid = vap->va_gid =
vap->va_fsid = vap->va_fileid =
vap->va_blocksize = vap->va_rdev =
vap->va_atime.ts_sec = vap->va_atime.ts_nsec =
vap->va_mtime.ts_sec = vap->va_mtime.ts_nsec =
vap->va_ctime.ts_sec = vap->va_ctime.ts_nsec =
vap->va_atime.tv_sec = vap->va_atime.tv_nsec =
vap->va_mtime.tv_sec = vap->va_mtime.tv_nsec =
vap->va_ctime.tv_sec = vap->va_ctime.tv_nsec =
vap->va_flags = vap->va_gen = VNOVAL;
vap->va_vaflags = 0;
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.49 1996/09/03 07:09:03 davidg Exp $
* $Id: vfs_syscalls.c,v 1.50 1996/09/03 14:21:53 bde Exp $
*/
/*
@ -1693,10 +1693,10 @@ utimes(p, uap, retval)
vp = nd.ni_vp;
LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE);
VOP_LOCK(vp);
vattr.va_atime.ts_sec = tv[0].tv_sec;
vattr.va_atime.ts_nsec = tv[0].tv_usec * 1000;
vattr.va_mtime.ts_sec = tv[1].tv_sec;
vattr.va_mtime.ts_nsec = tv[1].tv_usec * 1000;
vattr.va_atime.tv_sec = tv[0].tv_sec;
vattr.va_atime.tv_nsec = tv[0].tv_usec * 1000;
vattr.va_mtime.tv_sec = tv[1].tv_sec;
vattr.va_mtime.tv_nsec = tv[1].tv_usec * 1000;
error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
vput(vp);
return (error);

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_conv.c,v 1.8 1996/04/05 16:31:49 ache Exp $ */
/* $Id: msdosfs_conv.c,v 1.9 1996/04/05 18:59:06 ache Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.6.2.1 1994/08/30 02:27:57 cgd Exp $ */
/*
@ -77,7 +77,7 @@ unix2dostime(tsp, ddp, dtp)
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
t = tsp->ts_sec - (tz.tz_minuteswest * 60)
t = tsp->tv_sec - (tz.tz_minuteswest * 60)
- (wall_cmos_clock ? adjkerntz : 0);
/* - daylight savings time correction */
if (lasttime != t) {
@ -175,10 +175,10 @@ dos2unixtime(dd, dt, tsp)
days += ((dd & DD_DAY_MASK) >> DD_DAY_SHIFT) - 1;
lastseconds = (days * 24 * 60 * 60) + SECONDSTO1980;
}
tsp->ts_sec = seconds + lastseconds + (tz.tz_minuteswest * 60)
tsp->tv_sec = seconds + lastseconds + (tz.tz_minuteswest * 60)
+ adjkerntz;
/* + daylight savings time correction */
tsp->ts_nsec = 0;
tsp->tv_nsec = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vnops.c,v 1.31 1996/06/14 11:01:41 asami Exp $ */
/* $Id: msdosfs_vnops.c,v 1.32 1996/09/03 14:23:33 bde Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
/*-
@ -464,7 +464,7 @@ msdosfs_setattr(ap)
if (error)
return error;
}
if (vap->va_mtime.ts_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != dep->de_pmp->pm_uid &&

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
* $Id: nfs_bio.c,v 1.23 1996/06/08 05:59:04 pst Exp $
* $Id: nfs_bio.c,v 1.24 1996/07/16 10:19:43 dfr Exp $
*/
#include <sys/param.h>
@ -142,18 +142,18 @@ nfs_bioread(vp, uio, ioflag, cred)
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.ts_sec) {
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
nfs_invaldir(vp);
error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
}
}
}
@ -853,7 +853,7 @@ nfs_doio(bp, cr, p)
NQNFS_CKINVALID(vp, np, ND_READ) &&
np->n_lrev != np->n_brev) ||
(!(nmp->nm_flag & NFSMNT_NQNFS) &&
np->n_mtime != np->n_vattr.va_mtime.ts_sec))) {
np->n_mtime != np->n_vattr.va_mtime.tv_sec))) {
uprintf("Process killed due to text file modification\n");
psignal(p, SIGKILL);
#ifdef __NetBSD__

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_subs.c,v 1.31 1996/07/16 10:19:44 dfr Exp $
* $Id: nfs_subs.c,v 1.32 1996/08/21 21:55:51 dyson Exp $
*/
/*
@ -1311,7 +1311,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*vpp = vp = nvp;
}
}
np->n_mtime = mtime.ts_sec;
np->n_mtime = mtime.tv_sec;
}
vap = &np->n_vattr;
vap->va_type = vtyp;
@ -1341,8 +1341,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.ts_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.ts_nsec = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93
* $Id: nfsm_subs.h,v 1.7 1995/06/27 11:06:55 dfr Exp $
* $Id: nfsm_subs.h,v 1.8 1995/08/24 10:45:16 dfr Exp $
*/
#ifndef _NFS_NFSM_SUBS_H_
@ -426,8 +426,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_atime.ts_sec = time.tv_sec; \
(a)->va_atime.ts_nsec = time.tv_usec * 1000; \
(a)->va_atime.tv_sec = time.tv_sec; \
(a)->va_atime.tv_nsec = time.tv_usec * 1000; \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
@ -437,8 +437,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_mtime.ts_sec = time.tv_sec; \
(a)->va_mtime.ts_nsec = time.tv_usec * 1000; \
(a)->va_mtime.tv_sec = time.tv_sec; \
(a)->va_mtime.tv_nsec = time.tv_usec * 1000; \
break; \
}; }

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
* $Id: nfs_serv.c,v 1.32 1996/09/03 14:24:59 bde Exp $
* $Id: nfs_serv.c,v 1.33 1996/09/05 07:58:04 davidg Exp $
*/
/*
@ -282,9 +282,9 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
#ifdef notyet
fxdr_nfsv2time(&sp->sa_atime, &vap->va_atime);
#else
vap->va_atime.ts_sec =
vap->va_atime.tv_sec =
fxdr_unsigned(long, sp->sa_atime.nfsv2_sec);
vap->va_atime.ts_nsec = 0;
vap->va_atime.tv_nsec = 0;
#endif
}
if (sp->sa_mtime.nfsv2_sec != nfs_xdrneg1)
@ -305,8 +305,8 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
if (v3) {
error = preat_ret = VOP_GETATTR(vp, &preat, cred, procp);
if (!error && gcheck &&
(preat.va_ctime.ts_sec != guard.ts_sec ||
preat.va_ctime.ts_nsec != guard.ts_nsec))
(preat.va_ctime.tv_sec != guard.tv_sec ||
preat.va_ctime.tv_nsec != guard.tv_nsec))
error = NFSERR_NOT_SYNC;
if (error) {
vput(vp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_subs.c,v 1.31 1996/07/16 10:19:44 dfr Exp $
* $Id: nfs_subs.c,v 1.32 1996/08/21 21:55:51 dyson Exp $
*/
/*
@ -1311,7 +1311,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*vpp = vp = nvp;
}
}
np->n_mtime = mtime.ts_sec;
np->n_mtime = mtime.tv_sec;
}
vap = &np->n_vattr;
vap->va_type = vtyp;
@ -1341,8 +1341,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.ts_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.ts_nsec = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
* $Id: nfs_vnops.c,v 1.33 1996/01/25 00:45:37 bde Exp $
* $Id: nfs_vnops.c,v 1.34 1996/07/16 10:19:45 dfr Exp $
*/
/*
@ -483,18 +483,18 @@ nfs_open(ap)
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.ts_sec) {
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
if ((error = nfs_vinvalbuf(vp, V_SAVE,
ap->a_cred, ap->a_p, 1)) == EINTR)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
}
}
}
@ -634,8 +634,8 @@ nfs_setattr(ap)
* Disallow write attempts if the filesystem is mounted read-only.
*/
if ((vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL ||
vap->va_gid != (gid_t)VNOVAL || vap->va_atime.ts_sec != VNOVAL ||
vap->va_mtime.ts_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) &&
vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL ||
vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) &&
(vp->v_mount->mnt_flag & MNT_RDONLY))
return (EROFS);
if (vap->va_size != VNOVAL) {
@ -644,8 +644,8 @@ nfs_setattr(ap)
return (EISDIR);
case VCHR:
case VBLK:
if (vap->va_mtime.ts_sec == VNOVAL &&
vap->va_atime.ts_sec == VNOVAL &&
if (vap->va_mtime.tv_sec == VNOVAL &&
vap->va_atime.tv_sec == VNOVAL &&
vap->va_mode == (u_short)VNOVAL &&
vap->va_uid == (uid_t)VNOVAL &&
vap->va_gid == (gid_t)VNOVAL)
@ -671,8 +671,8 @@ nfs_setattr(ap)
np->n_size = np->n_vattr.va_size = vap->va_size;
vnode_pager_setsize(vp, (u_long)np->n_size);
};
} else if ((vap->va_mtime.ts_sec != VNOVAL ||
vap->va_atime.ts_sec != VNOVAL) &&
} else if ((vap->va_mtime.tv_sec != VNOVAL ||
vap->va_atime.tv_sec != VNOVAL) &&
vp->v_type == VREG &&
(error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
ap->a_p, 1)) == EINTR)
@ -740,8 +740,8 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_atime.ts_sec != VNOVAL) {
if (vap->va_atime.ts_sec != time.tv_sec) {
if (vap->va_atime.tv_sec != VNOVAL) {
if (vap->va_atime.tv_sec != time.tv_sec) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_atime, tl);
@ -753,8 +753,8 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (vap->va_mtime.ts_sec != VNOVAL) {
if (vap->va_mtime.ts_sec != time.tv_sec) {
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != time.tv_sec) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_mtime, tl);
@ -862,7 +862,7 @@ nfs_lookup(ap)
if (!error) {
if (vpid == newvp->v_id) {
if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, cnp->cn_proc)
&& vattr.va_ctime.ts_sec == VTONFS(newvp)->n_ctime) {
&& vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) {
nfsstats.lookupcache_hits++;
if (cnp->cn_nameiop != LOOKUP &&
(flags & ISLASTCN))
@ -957,7 +957,7 @@ nfs_lookup(ap)
cnp->cn_flags |= SAVENAME;
if ((cnp->cn_flags & MAKEENTRY) &&
(cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) {
np->n_ctime = np->n_vattr.va_ctime.ts_sec;
np->n_ctime = np->n_vattr.va_ctime.tv_sec;
cache_enter(dvp, newvp, cnp);
}
*vpp = newvp;
@ -1205,7 +1205,7 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
} else
nfsm_loadattr(vp, (struct vattr *)0);
if (wccflag)
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.ts_sec;
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
m_freem(mrep);
tsiz -= len;
}
@ -2012,7 +2012,7 @@ nfs_readdir(ap)
return (0);
}
} else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_procp) == 0 &&
np->n_mtime == vattr.va_mtime.ts_sec) {
np->n_mtime == vattr.va_mtime.tv_sec) {
nfsstats.direofcache_hits++;
return (0);
}
@ -3243,8 +3243,8 @@ nfsspec_read(ap)
* Set access flag.
*/
np->n_flag |= NACC;
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap));
}
@ -3266,8 +3266,8 @@ nfsspec_write(ap)
* Set update flag.
*/
np->n_flag |= NUPD;
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap));
}
@ -3322,8 +3322,8 @@ nfsfifo_read(ap)
* Set access flag.
*/
np->n_flag |= NACC;
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap));
}
@ -3345,8 +3345,8 @@ nfsfifo_write(ap)
* Set update flag.
*/
np->n_flag |= NUPD;
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap));
}
@ -3370,12 +3370,12 @@ nfsfifo_close(ap)
if (np->n_flag & (NACC | NUPD)) {
if (np->n_flag & NACC) {
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
}
if (np->n_flag & NUPD) {
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
}
np->n_flag |= NCHG;
if (vp->v_usecount == 1 &&

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93
* $Id: nfsm_subs.h,v 1.7 1995/06/27 11:06:55 dfr Exp $
* $Id: nfsm_subs.h,v 1.8 1995/08/24 10:45:16 dfr Exp $
*/
#ifndef _NFS_NFSM_SUBS_H_
@ -426,8 +426,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_atime.ts_sec = time.tv_sec; \
(a)->va_atime.ts_nsec = time.tv_usec * 1000; \
(a)->va_atime.tv_sec = time.tv_sec; \
(a)->va_atime.tv_nsec = time.tv_usec * 1000; \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
@ -437,8 +437,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_mtime.ts_sec = time.tv_sec; \
(a)->va_mtime.ts_nsec = time.tv_usec * 1000; \
(a)->va_mtime.tv_sec = time.tv_sec; \
(a)->va_mtime.tv_nsec = time.tv_usec * 1000; \
break; \
}; }

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
* $Id: xdr_subs.h,v 1.4 1995/01/10 13:11:42 davidg Exp $
* $Id: xdr_subs.h,v 1.5 1995/06/27 11:07:03 dfr Exp $
*/
#ifndef _NFS_XDR_SUBS_H_
@ -55,27 +55,27 @@
#define txdr_unsigned(v) (htonl((long)(v)))
#define fxdr_nfsv2time(f, t) { \
(t)->ts_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
(t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \
(t)->ts_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
(t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
else \
(t)->ts_nsec = 0; \
(t)->tv_nsec = 0; \
}
#define txdr_nfsv2time(f, t) { \
((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->ts_sec); \
if ((f)->ts_nsec != -1) \
((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->ts_nsec / 1000); \
((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \
if ((f)->tv_nsec != -1) \
((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \
else \
((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \
}
#define fxdr_nfsv3time(f, t) { \
(t)->ts_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
(t)->ts_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
(t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
(t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
}
#define txdr_nfsv3time(f, t) { \
((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->ts_sec); \
((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->ts_nsec); \
((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \
((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \
}
#define fxdr_hyper(f, t) { \

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
* $Id: nfs_bio.c,v 1.23 1996/06/08 05:59:04 pst Exp $
* $Id: nfs_bio.c,v 1.24 1996/07/16 10:19:43 dfr Exp $
*/
#include <sys/param.h>
@ -142,18 +142,18 @@ nfs_bioread(vp, uio, ioflag, cred)
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.ts_sec) {
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
nfs_invaldir(vp);
error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
}
}
}
@ -853,7 +853,7 @@ nfs_doio(bp, cr, p)
NQNFS_CKINVALID(vp, np, ND_READ) &&
np->n_lrev != np->n_brev) ||
(!(nmp->nm_flag & NFSMNT_NQNFS) &&
np->n_mtime != np->n_vattr.va_mtime.ts_sec))) {
np->n_mtime != np->n_vattr.va_mtime.tv_sec))) {
uprintf("Process killed due to text file modification\n");
psignal(p, SIGKILL);
#ifdef __NetBSD__

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_subs.c,v 1.31 1996/07/16 10:19:44 dfr Exp $
* $Id: nfs_subs.c,v 1.32 1996/08/21 21:55:51 dyson Exp $
*/
/*
@ -1311,7 +1311,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*vpp = vp = nvp;
}
}
np->n_mtime = mtime.ts_sec;
np->n_mtime = mtime.tv_sec;
}
vap = &np->n_vattr;
vap->va_type = vtyp;
@ -1341,8 +1341,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.ts_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.ts_nsec = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
* $Id: nfs_vnops.c,v 1.33 1996/01/25 00:45:37 bde Exp $
* $Id: nfs_vnops.c,v 1.34 1996/07/16 10:19:45 dfr Exp $
*/
/*
@ -483,18 +483,18 @@ nfs_open(ap)
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.ts_sec) {
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
if ((error = nfs_vinvalbuf(vp, V_SAVE,
ap->a_cred, ap->a_p, 1)) == EINTR)
return (error);
np->n_mtime = vattr.va_mtime.ts_sec;
np->n_mtime = vattr.va_mtime.tv_sec;
}
}
}
@ -634,8 +634,8 @@ nfs_setattr(ap)
* Disallow write attempts if the filesystem is mounted read-only.
*/
if ((vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL ||
vap->va_gid != (gid_t)VNOVAL || vap->va_atime.ts_sec != VNOVAL ||
vap->va_mtime.ts_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) &&
vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL ||
vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) &&
(vp->v_mount->mnt_flag & MNT_RDONLY))
return (EROFS);
if (vap->va_size != VNOVAL) {
@ -644,8 +644,8 @@ nfs_setattr(ap)
return (EISDIR);
case VCHR:
case VBLK:
if (vap->va_mtime.ts_sec == VNOVAL &&
vap->va_atime.ts_sec == VNOVAL &&
if (vap->va_mtime.tv_sec == VNOVAL &&
vap->va_atime.tv_sec == VNOVAL &&
vap->va_mode == (u_short)VNOVAL &&
vap->va_uid == (uid_t)VNOVAL &&
vap->va_gid == (gid_t)VNOVAL)
@ -671,8 +671,8 @@ nfs_setattr(ap)
np->n_size = np->n_vattr.va_size = vap->va_size;
vnode_pager_setsize(vp, (u_long)np->n_size);
};
} else if ((vap->va_mtime.ts_sec != VNOVAL ||
vap->va_atime.ts_sec != VNOVAL) &&
} else if ((vap->va_mtime.tv_sec != VNOVAL ||
vap->va_atime.tv_sec != VNOVAL) &&
vp->v_type == VREG &&
(error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
ap->a_p, 1)) == EINTR)
@ -740,8 +740,8 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_atime.ts_sec != VNOVAL) {
if (vap->va_atime.ts_sec != time.tv_sec) {
if (vap->va_atime.tv_sec != VNOVAL) {
if (vap->va_atime.tv_sec != time.tv_sec) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_atime, tl);
@ -753,8 +753,8 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (vap->va_mtime.ts_sec != VNOVAL) {
if (vap->va_mtime.ts_sec != time.tv_sec) {
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != time.tv_sec) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_mtime, tl);
@ -862,7 +862,7 @@ nfs_lookup(ap)
if (!error) {
if (vpid == newvp->v_id) {
if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, cnp->cn_proc)
&& vattr.va_ctime.ts_sec == VTONFS(newvp)->n_ctime) {
&& vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) {
nfsstats.lookupcache_hits++;
if (cnp->cn_nameiop != LOOKUP &&
(flags & ISLASTCN))
@ -957,7 +957,7 @@ nfs_lookup(ap)
cnp->cn_flags |= SAVENAME;
if ((cnp->cn_flags & MAKEENTRY) &&
(cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) {
np->n_ctime = np->n_vattr.va_ctime.ts_sec;
np->n_ctime = np->n_vattr.va_ctime.tv_sec;
cache_enter(dvp, newvp, cnp);
}
*vpp = newvp;
@ -1205,7 +1205,7 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
} else
nfsm_loadattr(vp, (struct vattr *)0);
if (wccflag)
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.ts_sec;
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
m_freem(mrep);
tsiz -= len;
}
@ -2012,7 +2012,7 @@ nfs_readdir(ap)
return (0);
}
} else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_procp) == 0 &&
np->n_mtime == vattr.va_mtime.ts_sec) {
np->n_mtime == vattr.va_mtime.tv_sec) {
nfsstats.direofcache_hits++;
return (0);
}
@ -3243,8 +3243,8 @@ nfsspec_read(ap)
* Set access flag.
*/
np->n_flag |= NACC;
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap));
}
@ -3266,8 +3266,8 @@ nfsspec_write(ap)
* Set update flag.
*/
np->n_flag |= NUPD;
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap));
}
@ -3322,8 +3322,8 @@ nfsfifo_read(ap)
* Set access flag.
*/
np->n_flag |= NACC;
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap));
}
@ -3345,8 +3345,8 @@ nfsfifo_write(ap)
* Set update flag.
*/
np->n_flag |= NUPD;
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap));
}
@ -3370,12 +3370,12 @@ nfsfifo_close(ap)
if (np->n_flag & (NACC | NUPD)) {
if (np->n_flag & NACC) {
np->n_atim.ts_sec = time.tv_sec;
np->n_atim.ts_nsec = time.tv_usec * 1000;
np->n_atim.tv_sec = time.tv_sec;
np->n_atim.tv_nsec = time.tv_usec * 1000;
}
if (np->n_flag & NUPD) {
np->n_mtim.ts_sec = time.tv_sec;
np->n_mtim.ts_nsec = time.tv_usec * 1000;
np->n_mtim.tv_sec = time.tv_sec;
np->n_mtim.tv_nsec = time.tv_usec * 1000;
}
np->n_flag |= NCHG;
if (vp->v_usecount == 1 &&

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93
* $Id: nfsm_subs.h,v 1.7 1995/06/27 11:06:55 dfr Exp $
* $Id: nfsm_subs.h,v 1.8 1995/08/24 10:45:16 dfr Exp $
*/
#ifndef _NFS_NFSM_SUBS_H_
@ -426,8 +426,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_atime.ts_sec = time.tv_sec; \
(a)->va_atime.ts_nsec = time.tv_usec * 1000; \
(a)->va_atime.tv_sec = time.tv_sec; \
(a)->va_atime.tv_nsec = time.tv_usec * 1000; \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
@ -437,8 +437,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_mtime.ts_sec = time.tv_sec; \
(a)->va_mtime.ts_nsec = time.tv_usec * 1000; \
(a)->va_mtime.tv_sec = time.tv_sec; \
(a)->va_mtime.tv_nsec = time.tv_usec * 1000; \
break; \
}; }

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
* $Id: nfs_serv.c,v 1.32 1996/09/03 14:24:59 bde Exp $
* $Id: nfs_serv.c,v 1.33 1996/09/05 07:58:04 davidg Exp $
*/
/*
@ -282,9 +282,9 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
#ifdef notyet
fxdr_nfsv2time(&sp->sa_atime, &vap->va_atime);
#else
vap->va_atime.ts_sec =
vap->va_atime.tv_sec =
fxdr_unsigned(long, sp->sa_atime.nfsv2_sec);
vap->va_atime.ts_nsec = 0;
vap->va_atime.tv_nsec = 0;
#endif
}
if (sp->sa_mtime.nfsv2_sec != nfs_xdrneg1)
@ -305,8 +305,8 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
if (v3) {
error = preat_ret = VOP_GETATTR(vp, &preat, cred, procp);
if (!error && gcheck &&
(preat.va_ctime.ts_sec != guard.ts_sec ||
preat.va_ctime.ts_nsec != guard.ts_nsec))
(preat.va_ctime.tv_sec != guard.tv_sec ||
preat.va_ctime.tv_nsec != guard.tv_nsec))
error = NFSERR_NOT_SYNC;
if (error) {
vput(vp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_subs.c,v 1.31 1996/07/16 10:19:44 dfr Exp $
* $Id: nfs_subs.c,v 1.32 1996/08/21 21:55:51 dyson Exp $
*/
/*
@ -1311,7 +1311,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*vpp = vp = nvp;
}
}
np->n_mtime = mtime.ts_sec;
np->n_mtime = mtime.tv_sec;
}
vap = &np->n_vattr;
vap->va_type = vtyp;
@ -1341,8 +1341,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.ts_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.ts_nsec = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93
* $Id: nfsm_subs.h,v 1.7 1995/06/27 11:06:55 dfr Exp $
* $Id: nfsm_subs.h,v 1.8 1995/08/24 10:45:16 dfr Exp $
*/
#ifndef _NFS_NFSM_SUBS_H_
@ -426,8 +426,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_atime.ts_sec = time.tv_sec; \
(a)->va_atime.ts_nsec = time.tv_usec * 1000; \
(a)->va_atime.tv_sec = time.tv_sec; \
(a)->va_atime.tv_nsec = time.tv_usec * 1000; \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
@ -437,8 +437,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
(a)->va_mtime.ts_sec = time.tv_sec; \
(a)->va_mtime.ts_nsec = time.tv_usec * 1000; \
(a)->va_mtime.tv_sec = time.tv_sec; \
(a)->va_mtime.tv_nsec = time.tv_usec * 1000; \
break; \
}; }

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)stat.h 8.12 (Berkeley) 6/16/95
* $Id: stat.h,v 1.7 1996/02/24 11:19:43 hsu Exp $
* $Id: stat.h,v 1.7 1996/03/11 02:15:04 hsu Exp $
*/
#ifndef _SYS_STAT_H_
@ -98,9 +98,9 @@ struct stat {
int64_t st_qspare[2];
};
#ifndef _POSIX_SOURCE
#define st_atime st_atimespec.ts_sec
#define st_mtime st_mtimespec.ts_sec
#define st_ctime st_ctimespec.ts_sec
#define st_atime st_atimespec.tv_sec
#define st_mtime st_mtimespec.tv_sec
#define st_ctime st_ctimespec.tv_sec
#endif
#define S_ISUID 0004000 /* set user id on execution */

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* $Id: time.h,v 1.7 1996/02/24 07:41:46 hsu Exp $
* $Id: time.h,v 1.7 1996/03/11 02:11:25 hsu Exp $
*/
#ifndef _SYS_TIME_H_
@ -52,17 +52,17 @@ struct timeval {
* Structure defined by POSIX.4 to be like a timeval.
*/
struct timespec {
time_t ts_sec; /* seconds */
long ts_nsec; /* and nanoseconds */
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
(ts)->ts_sec = (tv)->tv_sec; \
(ts)->ts_nsec = (tv)->tv_usec * 1000; \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->ts_sec; \
(tv)->tv_usec = (ts)->ts_nsec / 1000; \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
struct timezone {

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* $Id: time.h,v 1.7 1996/02/24 07:41:46 hsu Exp $
* $Id: time.h,v 1.7 1996/03/11 02:11:25 hsu Exp $
*/
#ifndef _SYS_TIME_H_
@ -52,17 +52,17 @@ struct timeval {
* Structure defined by POSIX.4 to be like a timeval.
*/
struct timespec {
time_t ts_sec; /* seconds */
long ts_nsec; /* and nanoseconds */
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
(ts)->ts_sec = (tv)->tv_sec; \
(ts)->ts_nsec = (tv)->tv_usec * 1000; \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->ts_sec; \
(tv)->tv_usec = (ts)->ts_nsec / 1000; \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
struct timezone {

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93
* $Id: ffs_inode.c,v 1.19 1996/01/05 18:31:48 wollman Exp $
* $Id: ffs_inode.c,v 1.20 1996/01/19 03:59:12 dyson Exp $
*/
#include "opt_quota.h"
@ -115,15 +115,15 @@ ffs_update(ap)
*/
tv_sec = time.tv_sec;
if (ip->i_flag & IN_ACCESS)
ip->i_atime.ts_sec =
ip->i_atime.tv_sec =
(ap->a_access == &time ? tv_sec : ap->a_access->tv_sec);
if (ip->i_flag & IN_UPDATE) {
ip->i_mtime.ts_sec =
ip->i_mtime.tv_sec =
(ap->a_modify == &time ? tv_sec : ap->a_modify->tv_sec);
ip->i_modrev++;
}
if (ip->i_flag & IN_CHANGE)
ip->i_ctime.ts_sec = tv_sec;
ip->i_ctime.tv_sec = tv_sec;
ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
fs = ip->i_fs;
/*

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)inode.h 8.4 (Berkeley) 1/21/94
* $Id: inode.h,v 1.7 1995/11/05 23:35:56 dyson Exp $
* $Id: inode.h,v 1.8 1996/01/30 23:02:15 mpp Exp $
*/
#ifndef _UFS_UFS_INODE_H_
@ -155,15 +155,15 @@ struct indir {
if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
(ip)->i_flag |= IN_MODIFIED; \
if ((ip)->i_flag & IN_ACCESS) \
(ip)->i_atime.ts_sec \
(ip)->i_atime.tv_sec \
= ((t1) == &time ? tv_sec : (t1)->tv_sec); \
if ((ip)->i_flag & IN_UPDATE) { \
(ip)->i_mtime.ts_sec \
(ip)->i_mtime.tv_sec \
= ((t2) == &time ? tv_sec : (t2)->tv_sec); \
(ip)->i_modrev++; \
} \
if ((ip)->i_flag & IN_CHANGE) \
(ip)->i_ctime.ts_sec = tv_sec; \
(ip)->i_ctime.tv_sec = tv_sec; \
(ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
} \
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94
* $Id: ufs_vnops.c,v 1.39 1996/07/09 16:51:18 wollman Exp $
* $Id: ufs_vnops.c,v 1.40 1996/09/03 14:25:27 bde Exp $
*/
#include "opt_quota.h"
@ -417,7 +417,7 @@ ufs_setattr(ap)
return (error);
}
ip = VTOI(vp);
if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) {
if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != ip->i_uid &&
@ -425,14 +425,14 @@ ufs_setattr(ap)
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
(error = VOP_ACCESS(vp, VWRITE, cred, p))))
return (error);
if (vap->va_atime.ts_sec != VNOVAL)
if (vap->va_atime.tv_sec != VNOVAL)
ip->i_flag |= IN_ACCESS;
if (vap->va_mtime.ts_sec != VNOVAL)
if (vap->va_mtime.tv_sec != VNOVAL)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
atimeval.tv_sec = vap->va_atime.ts_sec;
atimeval.tv_usec = vap->va_atime.ts_nsec / 1000;
mtimeval.tv_sec = vap->va_mtime.ts_sec;
mtimeval.tv_usec = vap->va_mtime.ts_nsec / 1000;
atimeval.tv_sec = vap->va_atime.tv_sec;
atimeval.tv_usec = vap->va_atime.tv_nsec / 1000;
mtimeval.tv_sec = vap->va_mtime.tv_sec;
mtimeval.tv_usec = vap->va_mtime.tv_nsec / 1000;
error = VOP_UPDATE(vp, &atimeval, &mtimeval, 1);
if (error)
return (error);