aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2008-07-22 21:27:22 +0000
committerEd Schouten <ed@FreeBSD.org>2008-07-22 21:27:22 +0000
commit8c2ceafebf0fe2c49d3b5d56a7d654194fa9bc7b (patch)
tree4fe889d36172171178190558d3aff2196e25613c /sys/nfsclient
parentfbbc785240296e150fe41b8a8495e7c2f94170d0 (diff)
downloadsrc-8c2ceafebf0fe2c49d3b5d56a7d654194fa9bc7b.tar.gz
src-8c2ceafebf0fe2c49d3b5d56a7d654194fa9bc7b.zip
Move the NFS/RPC code away from lbolt.
The kernel has a special wchan called `lbolt', which is triggered each second. It doesn't seem to be used a lot and it seems pretty redundant, because we can specify a timeout value to the *sleep() routines. In an attempt to eventually remove lbolt, make the NFS/RPC code use a timeout of `hz' when trying to reconnect. Only the TTY code (not MPSAFE TTY) and the VFS syncer seem to use lbolt now. Reviewed by: attilio, jhb Approved by: philip (mentor), alfred, dfr
Notes
Notes: svn path=/head/; revision=180724
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_socket.c11
-rw-r--r--sys/nfsclient/nfs_vfsops.c4
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 140edb481bc3..34203f68e892 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -81,8 +81,9 @@ static int nfs_realign_test;
static int nfs_realign_count;
static int nfs_bufpackets = 4;
static int nfs_reconnects;
-static int nfs3_jukebox_delay = 10;
-static int nfs_skip_wcc_data_onerr = 1;
+static int nfs3_jukebox_delay = 10;
+static int nfs_skip_wcc_data_onerr = 1;
+static int fake_wchan;
SYSCTL_DECL(_vfs_nfs);
@@ -546,7 +547,7 @@ nfs_reconnect(struct nfsreq *rep)
mtx_lock(&nmp->nm_mtx);
goto unlock_exit;
}
- (void) tsleep(&lbolt, PSOCK, "nfscon", 0);
+ (void) tsleep(&fake_wchan, PSOCK, "nfscon", hz);
}
/*
@@ -1346,7 +1347,7 @@ wait_for_pinned_req:
error = 0;
waituntil = time_second + nfs3_jukebox_delay;
while (time_second < waituntil) {
- (void) tsleep(&lbolt, PSOCK, "nqnfstry", 0);
+ (void) tsleep(&fake_wchan, PSOCK, "nqnfstry", hz);
}
rep->r_xid = *xidp = txdr_unsigned(nfs_xid_gen());
goto tryagain;
@@ -1610,7 +1611,7 @@ nfs_nmcancelreqs(nmp)
mtx_unlock(&nfs_reqq_mtx);
if (req == NULL)
return (0);
- tsleep(&lbolt, PSOCK, "nfscancel", 0);
+ tsleep(&fake_wchan, PSOCK, "nfscancel", hz);
}
return (EBUSY);
}
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index c21b48ec2b97..85b85038f89a 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -117,6 +117,8 @@ static vfs_statfs_t nfs_statfs;
static vfs_sync_t nfs_sync;
static vfs_sysctl_t nfs_sysctl;
+static int fake_wchan;
+
/*
* nfs vfs operations.
*/
@@ -700,7 +702,7 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp)
if (nmp->nm_sotype == SOCK_DGRAM)
while (nfs_connect(nmp, NULL)) {
printf("nfs_args: retrying connect\n");
- (void) tsleep((caddr_t)&lbolt, PSOCK, "nfscon", 0);
+ (void) tsleep(&fake_wchan, PSOCK, "nfscon", hz);
}
}