summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/nfs/nfs_serv.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 5e47d649aea7..1e8d8d5687a9 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -129,7 +129,9 @@ extern struct nfsstats nfsstats;
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
int nfsrvw_procrastinate_v3 = 0;
+static struct timeval nfsver = { 0 };
static int nfs_async;
+
SYSCTL_INT(_vfs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, "");
static int nfsrv_access __P((struct vnode *,int,struct ucred *,int,
@@ -1120,8 +1122,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
@@ -1406,8 +1410,10 @@ loop1:
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(&va, fp);
@@ -3636,8 +3642,10 @@ nfsrv_commit(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
error = 0;
}