From f2293255a968c5601acdd20c7bde624dd3a937dc Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 25 Jan 2013 15:25:24 +0000 Subject: Further cleanups to use of timestamps 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(). Submitted by: bde (3) Reviewed by: bde, rmacklem MFC after: 2 weeks --- sys/nfsclient/nfs_krpc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'sys/nfsclient') diff --git a/sys/nfsclient/nfs_krpc.c b/sys/nfsclient/nfs_krpc.c index 731e2ea..dd441ae 100644 --- a/sys/nfsclient/nfs_krpc.c +++ b/sys/nfsclient/nfs_krpc.c @@ -394,18 +394,17 @@ nfs_feedback(int type, int proc, void *arg) { 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 mbuf *mreq, int procnum, 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 mbuf *mreq, int procnum, 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)); /* -- cgit v1.1