summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-01-25 15:25:24 +0000
committerjhb <jhb@FreeBSD.org>2013-01-25 15:25:24 +0000
commitf2293255a968c5601acdd20c7bde624dd3a937dc (patch)
tree8118de6c283bb3e22b23286a254853555a8badaf /sys/nfsclient
parentfa34eceef79e479ff9977bba93253e5940d8def0 (diff)
downloadFreeBSD-src-f2293255a968c5601acdd20c7bde624dd3a937dc.zip
FreeBSD-src-f2293255a968c5601acdd20c7bde624dd3a937dc.tar.gz
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
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_krpc.c13
1 files changed, 5 insertions, 8 deletions
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));
/*
OpenPOWER on IntegriCloud