summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-12-16 17:01:32 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-12-16 17:01:32 +0000
commit2cac06495e79c942f4c12337b3faf18d9e89f33c (patch)
tree7d0d9158c635549c263137baf512cb24a88f1552
parentd16b0d7ab5f1c1eeb96af0d5aee40f9dfc4850e2 (diff)
Notes
-rw-r--r--sys/nfs/nfs_serv.c20
-rw-r--r--sys/nfsserver/nfs_serv.c20
2 files changed, 28 insertions, 12 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 405e43751739..d535483a69b7 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -133,6 +133,8 @@ extern struct nfsstats nfsstats;
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
int nfsrvw_procrastinate_v3 = 0;
+static struct timeval nfsver = { 0 };
+
SYSCTL_DECL(_vfs_nfs);
static int nfs_async;
@@ -1192,8 +1194,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);
@@ -1478,8 +1482,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);
@@ -3681,8 +3687,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;
}
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 405e43751739..d535483a69b7 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -133,6 +133,8 @@ extern struct nfsstats nfsstats;
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
int nfsrvw_procrastinate_v3 = 0;
+static struct timeval nfsver = { 0 };
+
SYSCTL_DECL(_vfs_nfs);
static int nfs_async;
@@ -1192,8 +1194,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);
@@ -1478,8 +1482,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);
@@ -3681,8 +3687,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;
}