svn commit: r247502 - in stable/9/sys: fs/nfs fs/nfsclient fs/nfsserver nfs nfsclient nfsserver

John Baldwin jhb at FreeBSD.org
Thu Feb 28 21:57:42 UTC 2013


Author: jhb
Date: Thu Feb 28 21:57:38 2013
New Revision: 247502
URL: http://svnweb.freebsd.org/changeset/base/247502

Log:
  MFC 245508,245566,245568,245611,245909:
  Various fixes to timestamps in NFS:
  - Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes()
    instead of comparing the desired time against the current time as a
    heuristic.
  - Remove unused nfs_curusec().
  - Use vfs_timestamp() to set file timestamps rather than invoking
    getmicrotime() or getnanotime() directly in NFS.
  - Use NFSD_MONOSEC (which maps to time_uptime) instead of the seconds
    portion of wall-time stamps to manage timeouts on events.
  - Remove unused nd_starttime from the per-request structure in the new
    NFS server.
  - Use nanotime() for the modification time on a delegation to get as
    precise a time as possible.
  - Use time_second instead of extracting the second from a call to
    getmicrotime().

Modified:
  stable/9/sys/fs/nfs/nfs.h
  stable/9/sys/fs/nfs/nfs_commonkrpc.c
  stable/9/sys/fs/nfs/nfs_commonsubs.c
  stable/9/sys/fs/nfs/nfsport.h
  stable/9/sys/fs/nfsclient/nfs_clport.c
  stable/9/sys/fs/nfsclient/nfs_clstate.c
  stable/9/sys/fs/nfsclient/nfs_clvnops.c
  stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
  stable/9/sys/fs/nfsserver/nfs_nfsdport.c
  stable/9/sys/fs/nfsserver/nfs_nfsdstate.c
  stable/9/sys/nfs/nfs_common.c
  stable/9/sys/nfs/nfs_common.h
  stable/9/sys/nfsclient/nfs_krpc.c
  stable/9/sys/nfsclient/nfs_subs.c
  stable/9/sys/nfsclient/nfs_vnops.c
  stable/9/sys/nfsserver/nfs_srvsubs.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfs/nfs.h
==============================================================================
--- stable/9/sys/fs/nfs/nfs.h	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfs/nfs.h	Thu Feb 28 21:57:38 2013	(r247502)
@@ -519,7 +519,6 @@ struct nfsrv_descript {
 	int			*nd_errp;	/* Pointer to ret status */
 	u_int32_t		nd_retxid;	/* Reply xid */
 	struct nfsrvcache	*nd_rp;		/* Assoc. cache entry */
-	struct timeval		nd_starttime;	/* Time RPC initiated */
 	fhandle_t		nd_fh;		/* File handle */
 	struct ucred		*nd_cred;	/* Credentials */
 	uid_t			nd_saveduid;	/* Saved uid */

Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -436,18 +436,17 @@ nfs_feedback(int type, int proc, void *a
 {
 	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
 	struct nfsmount *nmp = nf->nf_mount;
-	struct timeval now;
-
-	getmicrouptime(&now);
+	time_t now;
 
 	switch (type) {
 	case FEEDBACK_REXMIT2:
 	case FEEDBACK_RECONNECT:
-		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
+		now = NFSD_MONOSEC;
+		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
 			nfs_down(nmp, nf->nf_td,
 			    "not responding", 0, NFSSTA_TIMEO);
 			nf->nf_tprintfmsg = TRUE;
-			nf->nf_lastmsg = now.tv_sec;
+			nf->nf_lastmsg = now;
 		}
 		break;
 
@@ -477,7 +476,7 @@ newnfs_request(struct nfsrv_descript *nd
 	u_int16_t procnum;
 	u_int trylater_delay = 1;
 	struct nfs_feedback_arg nf;
-	struct timeval timo, now;
+	struct timeval timo;
 	AUTH *auth;
 	struct rpc_callextra ext;
 	enum clnt_stat stat;
@@ -593,8 +592,7 @@ newnfs_request(struct nfsrv_descript *nd
 		bzero(&nf, sizeof(struct nfs_feedback_arg));
 		nf.nf_mount = nmp;
 		nf.nf_td = td;
-		getmicrouptime(&now);
-		nf.nf_lastmsg = now.tv_sec -
+		nf.nf_lastmsg = NFSD_MONOSEC -
 		    ((nmp->nm_tprintf_delay)-(nmp->nm_tprintf_initial_delay));
 	}
 

Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- stable/9/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -1980,7 +1980,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 	struct statfs fs;
 	struct nfsfsinfo fsinf;
 	struct timespec temptime;
-	struct timeval curtime;
 	NFSACL_T *aclp, *naclp = NULL;
 #ifdef QUOTA
 	struct dqblk dqb;
@@ -2394,8 +2393,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 			retnum += NFSX_V4TIME;
 			break;
 		case NFSATTRBIT_TIMEACCESSSET:
-			NFSGETTIME(&curtime);
-			if (vap->va_atime.tv_sec != curtime.tv_sec) {
+			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
 				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
 				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
 				txdr_nfsv4time(&vap->va_atime, tl);
@@ -2424,8 +2422,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 			retnum += NFSX_V4TIME;
 			break;
 		case NFSATTRBIT_TIMEMODIFYSET:
-			NFSGETTIME(&curtime);
-			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
+			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
 				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
 				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
 				txdr_nfsv4time(&vap->va_mtime, tl);

Modified: stable/9/sys/fs/nfs/nfsport.h
==============================================================================
--- stable/9/sys/fs/nfs/nfsport.h	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfs/nfsport.h	Thu Feb 28 21:57:38 2013	(r247502)
@@ -526,12 +526,6 @@ void nfsrvd_rcv(struct socket *, void *,
 #define	NCHNAMLEN	9999999
 
 /*
- * Define these to use the time of day clock.
- */
-#define	NFSGETTIME(t)		(getmicrotime(t))
-#define	NFSGETNANOTIME(t)	(getnanotime(t))
-
-/*
  * These macros are defined to initialize and set the timer routine.
  */
 #define	NFS_TIMERINIT \

Modified: stable/9/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -732,7 +732,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
 	u_int32_t *tl;
 	struct nfsv2_sattr *sp;
 	nfsattrbit_t attrbits;
-	struct timeval curtime;
 
 	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
 	case ND_NFSV2:
@@ -761,7 +760,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
 		txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
 		break;
 	case ND_NFSV3:
-		getmicrotime(&curtime);
 		if (vap->va_mode != (mode_t)VNOVAL) {
 			NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
 			*tl++ = newnfs_true;
@@ -795,7 +793,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
 			*tl = newnfs_false;
 		}
 		if (vap->va_atime.tv_sec != VNOVAL) {
-			if (vap->va_atime.tv_sec != curtime.tv_sec) {
+			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
 				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
 				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
 				txdr_nfsv3time(&vap->va_atime, tl);
@@ -808,7 +806,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
 			*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
 		}
 		if (vap->va_mtime.tv_sec != VNOVAL) {
-			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
+			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
 				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
 				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
 				txdr_nfsv3time(&vap->va_mtime, tl);

Modified: stable/9/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -2394,7 +2394,7 @@ nfscl_renewthread(struct nfsclclient *cl
 	u_int32_t clidrev;
 	int error, cbpathdown, islept, igotlock, ret, clearok;
 	uint32_t recover_done_time = 0;
-	struct timespec mytime;
+	time_t mytime;
 	static time_t prevsec = 0;
 	struct nfscllockownerfh *lfhp, *nlfhp;
 	struct nfscllockownerfhhead lfh;
@@ -2559,9 +2559,9 @@ tryagain:
 		 * Call nfscl_cleanupkext() once per second to check for
 		 * open/lock owners where the process has exited.
 		 */
-		NFSGETNANOTIME(&mytime);
-		if (prevsec != mytime.tv_sec) {
-			prevsec = mytime.tv_sec;
+		mytime = NFSD_MONOSEC;
+		if (prevsec != mytime) {
+			prevsec = mytime;
 			nfscl_cleanupkext(clp, &lfh);
 		}
 
@@ -4174,7 +4174,7 @@ nfscl_delegmodtime(vnode_t vp)
 	}
 	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
 	if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) {
-		NFSGETNANOTIME(&dp->nfsdl_modtime);
+		nanotime(&dp->nfsdl_modtime);
 		dp->nfsdl_flags |= NFSCLDL_MODTIMESET;
 	}
 	NFSUNLOCKCLSTATE();

Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -3229,7 +3229,7 @@ nfsfifo_read(struct vop_read_args *ap)
 	 */
 	mtx_lock(&np->n_mtx);
 	np->n_flag |= NACC;
-	getnanotime(&np->n_atim);
+	vfs_timestamp(&np->n_atim);
 	mtx_unlock(&np->n_mtx);
 	error = fifo_specops.vop_read(ap);
 	return error;	
@@ -3248,7 +3248,7 @@ nfsfifo_write(struct vop_write_args *ap)
 	 */
 	mtx_lock(&np->n_mtx);
 	np->n_flag |= NUPD;
-	getnanotime(&np->n_mtim);
+	vfs_timestamp(&np->n_mtim);
 	mtx_unlock(&np->n_mtx);
 	return(fifo_specops.vop_write(ap));
 }
@@ -3268,7 +3268,7 @@ nfsfifo_close(struct vop_close_args *ap)
 
 	mtx_lock(&np->n_mtx);
 	if (np->n_flag & (NACC | NUPD)) {
-		getnanotime(&ts);
+		vfs_timestamp(&ts);
 		if (np->n_flag & NACC)
 			np->n_atim = ts;
 		if (np->n_flag & NUPD)

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
==============================================================================
--- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -310,7 +310,6 @@ nfs_proc(struct nfsrv_descript *nd, u_in
 	} else {
 		isdgram = 1;
 	}
-	NFSGETTIME(&nd->nd_starttime);
 
 	/*
 	 * Two cases:

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -1477,7 +1477,7 @@ nfsvno_updfilerev(struct vnode *vp, stru
 	struct vattr va;
 
 	VATTR_NULL(&va);
-	getnanotime(&va.va_mtime);
+	vfs_timestamp(&va.va_mtime);
 	(void) VOP_SETATTR(vp, &va, cred);
 	(void) nfsvno_getattr(vp, nvap, cred, p, 1);
 }
@@ -2250,7 +2250,6 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
 {
 	u_int32_t *tl;
 	struct nfsv2_sattr *sp;
-	struct timeval curtime;
 	int error = 0, toclient = 0;
 
 	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
@@ -2309,9 +2308,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
 			toclient = 1;
 			break;
 		case NFSV3SATTRTIME_TOSERVER:
-			NFSGETTIME(&curtime);
-			nvap->na_atime.tv_sec = curtime.tv_sec;
-			nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
+			vfs_timestamp(&nvap->na_atime);
 			nvap->na_vaflags |= VA_UTIMES_NULL;
 			break;
 		};
@@ -2323,9 +2320,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
 			nvap->na_vaflags &= ~VA_UTIMES_NULL;
 			break;
 		case NFSV3SATTRTIME_TOSERVER:
-			NFSGETTIME(&curtime);
-			nvap->na_mtime.tv_sec = curtime.tv_sec;
-			nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
+			vfs_timestamp(&nvap->na_mtime);
 			if (!toclient)
 				nvap->na_vaflags |= VA_UTIMES_NULL;
 			break;
@@ -2355,7 +2350,6 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
 	u_char *cp, namestr[NFSV4_SMALLSTR + 1];
 	uid_t uid;
 	gid_t gid;
-	struct timeval curtime;
 
 	error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup);
 	if (error)
@@ -2490,9 +2484,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
 			    toclient = 1;
 			    attrsum += NFSX_V4TIME;
 			} else {
-			    NFSGETTIME(&curtime);
-			    nvap->na_atime.tv_sec = curtime.tv_sec;
-			    nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
+			    vfs_timestamp(&nvap->na_atime);
 			    nvap->na_vaflags |= VA_UTIMES_NULL;
 			}
 			break;
@@ -2517,9 +2509,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
 			    nvap->na_vaflags &= ~VA_UTIMES_NULL;
 			    attrsum += NFSX_V4TIME;
 			} else {
-			    NFSGETTIME(&curtime);
-			    nvap->na_mtime.tv_sec = curtime.tv_sec;
-			    nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
+			    vfs_timestamp(&nvap->na_mtime);
 			    if (!toclient)
 				nvap->na_vaflags |= VA_UTIMES_NULL;
 			}

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- stable/9/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -3966,7 +3966,6 @@ nfsrv_setupstable(NFSPROC_T *p)
 	int error, i, tryagain;
 	off_t off = 0;
 	ssize_t aresid, len;
-	struct timeval curtime;
 
 	/*
 	 * If NFSNSF_UPDATEDONE is set, this is a restart of the nfsds without
@@ -3977,8 +3976,7 @@ nfsrv_setupstable(NFSPROC_T *p)
 	/*
 	 * Set Grace over just until the file reads successfully.
 	 */
-	NFSGETTIME(&curtime);
-	nfsrvboottime = curtime.tv_sec;
+	nfsrvboottime = time_second;
 	LIST_INIT(&sf->nsf_head);
 	sf->nsf_flags = (NFSNSF_GRACEOVER | NFSNSF_NEEDLOCK);
 	sf->nsf_eograce = NFSD_MONOSEC + NFSRV_LEASEDELTA;
@@ -4649,8 +4647,7 @@ out:
 APPLESTATIC void
 nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
 {
-	struct timespec mytime;
-	int32_t starttime;
+	time_t starttime;
 	int error;
 
 	/*
@@ -4674,8 +4671,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
 	 * Now, call nfsrv_checkremove() in a loop while it returns
 	 * NFSERR_DELAY. Return upon any other error or when timed out.
 	 */
-	NFSGETNANOTIME(&mytime);
-	starttime = (u_int32_t)mytime.tv_sec;
+	starttime = NFSD_MONOSEC;
 	do {
 		if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) {
 			error = nfsrv_checkremove(vp, 0, p);
@@ -4683,11 +4679,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
 		} else
 			error = EPERM;
 		if (error == NFSERR_DELAY) {
-			NFSGETNANOTIME(&mytime);
-			if (((u_int32_t)mytime.tv_sec - starttime) >
-			    NFS_REMOVETIMEO &&
-			    ((u_int32_t)mytime.tv_sec - starttime) <
-			    100000)
+			if (NFSD_MONOSEC - starttime > NFS_REMOVETIMEO)
 				break;
 			/* Sleep for a short period of time */
 			(void) nfs_catnap(PZERO, 0, "nfsremove");
@@ -4948,9 +4940,7 @@ nfsrv_notsamecredname(struct nfsrv_descr
 static time_t
 nfsrv_leaseexpiry(void)
 {
-	struct timeval curtime;
 
-	NFSGETTIME(&curtime);
 	if (nfsrv_stablefirst.nsf_eograce > NFSD_MONOSEC)
 		return (NFSD_MONOSEC + 2 * (nfsrv_lease + NFSRV_LEASEDELTA));
 	return (NFSD_MONOSEC + nfsrv_lease + NFSRV_LEASEDELTA);

Modified: stable/9/sys/nfs/nfs_common.c
==============================================================================
--- stable/9/sys/nfs/nfs_common.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfs/nfs_common.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -90,15 +90,6 @@ static int nfs_realign_count;
 SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD,
     &nfs_realign_count, 0, "Number of mbuf realignments done");
 
-u_quad_t
-nfs_curusec(void)
-{
-	struct timeval tv;
-
-	getmicrotime(&tv);
-	return ((u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec);
-}
-
 /*
  * copies mbuf chain to the uio scatter/gather list
  */

Modified: stable/9/sys/nfs/nfs_common.h
==============================================================================
--- stable/9/sys/nfs/nfs_common.h	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfs/nfs_common.h	Thu Feb 28 21:57:38 2013	(r247502)
@@ -46,7 +46,6 @@ extern nfstype nfsv3_type[];
 #define	vtonfsv3_type(a)	txdr_unsigned(nfsv3_type[((int32_t)(a))])
 
 int	nfs_adv(struct mbuf **, caddr_t *, int, int);
-u_quad_t nfs_curusec(void);
 void	*nfsm_disct(struct mbuf **, caddr_t *, int, int, int);
 int	nfs_realign(struct mbuf **, int);
 

Modified: stable/9/sys/nfsclient/nfs_krpc.c
==============================================================================
--- stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -394,18 +394,17 @@ nfs_feedback(int type, int proc, void *a
 {
 	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
 	struct nfsmount *nmp = nf->nf_mount;
-	struct timeval now;
-
-	getmicrouptime(&now);
+	time_t now;
 
 	switch (type) {
 	case FEEDBACK_REXMIT2:
 	case FEEDBACK_RECONNECT:
-		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
+		now = time_uptime;
+		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
 			nfs_down(nmp, nf->nf_td,
 			    "not responding", 0, NFSSTA_TIMEO);
 			nf->nf_tprintfmsg = TRUE;
-			nf->nf_lastmsg = now.tv_sec;
+			nf->nf_lastmsg = now;
 		}
 		break;
 
@@ -438,7 +437,6 @@ nfs_request(struct vnode *vp, struct mbu
 	time_t waituntil;
 	caddr_t dpos;
 	int error = 0, timeo;
-	struct timeval now;
 	AUTH *auth = NULL;
 	enum nfs_rto_timer_t timer;
 	struct nfs_feedback_arg nf;
@@ -455,8 +453,7 @@ nfs_request(struct vnode *vp, struct mbu
 	bzero(&nf, sizeof(struct nfs_feedback_arg));
 	nf.nf_mount = nmp;
 	nf.nf_td = td;
-	getmicrouptime(&now);
-	nf.nf_lastmsg = now.tv_sec -
+	nf.nf_lastmsg = time_uptime -
 	    ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay));
 
 	/*

Modified: stable/9/sys/nfsclient/nfs_subs.c
==============================================================================
--- stable/9/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -1110,7 +1110,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
 		*tl = nfs_false;
 	}
 	if (va->va_atime.tv_sec != VNOVAL) {
-		if (va->va_atime.tv_sec != time_second) {
+		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
 			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
 			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
 			txdr_nfsv3time(&va->va_atime, tl);
@@ -1123,7 +1123,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
 		*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
 	}
 	if (va->va_mtime.tv_sec != VNOVAL) {
-		if (va->va_mtime.tv_sec != time_second) {
+		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
 			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
 			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
 			txdr_nfsv3time(&va->va_mtime, tl);

Modified: stable/9/sys/nfsclient/nfs_vnops.c
==============================================================================
--- stable/9/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -3460,7 +3460,7 @@ nfsfifo_read(struct vop_read_args *ap)
 	 */
 	mtx_lock(&np->n_mtx);
 	np->n_flag |= NACC;
-	getnanotime(&np->n_atim);
+	vfs_timestamp(&np->n_atim);
 	mtx_unlock(&np->n_mtx);
 	error = fifo_specops.vop_read(ap);
 	return error;	
@@ -3479,7 +3479,7 @@ nfsfifo_write(struct vop_write_args *ap)
 	 */
 	mtx_lock(&np->n_mtx);
 	np->n_flag |= NUPD;
-	getnanotime(&np->n_mtim);
+	vfs_timestamp(&np->n_mtim);
 	mtx_unlock(&np->n_mtx);
 	return(fifo_specops.vop_write(ap));
 }
@@ -3499,7 +3499,7 @@ nfsfifo_close(struct vop_close_args *ap)
 
 	mtx_lock(&np->n_mtx);
 	if (np->n_flag & (NACC | NUPD)) {
-		getnanotime(&ts);
+		vfs_timestamp(&ts);
 		if (np->n_flag & NACC)
 			np->n_atim = ts;
 		if (np->n_flag & NUPD)

Modified: stable/9/sys/nfsserver/nfs_srvsubs.c
==============================================================================
--- stable/9/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:55:57 2013	(r247501)
+++ stable/9/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
@@ -1430,7 +1430,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
 		toclient = 1;
 		break;
 	case NFSV3SATTRTIME_TOSERVER:
-		getnanotime(&(a)->va_atime);
+		vfs_timestamp(&a->va_atime);
 		a->va_vaflags |= VA_UTIMES_NULL;
 		break;
 	}
@@ -1446,7 +1446,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
 		a->va_vaflags &= ~VA_UTIMES_NULL;
 		break;
 	case NFSV3SATTRTIME_TOSERVER:
-		getnanotime(&(a)->va_mtime);
+		vfs_timestamp(&a->va_mtime);
 		if (toclient == 0)
 			a->va_vaflags |= VA_UTIMES_NULL;
 		break;


More information about the svn-src-stable-9 mailing list