diff options
author | Ed Schouten <ed@FreeBSD.org> | 2008-07-22 21:27:22 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2008-07-22 21:27:22 +0000 |
commit | 8c2ceafebf0fe2c49d3b5d56a7d654194fa9bc7b (patch) | |
tree | 4fe889d36172171178190558d3aff2196e25613c /sys/nfs4client | |
parent | fbbc785240296e150fe41b8a8495e7c2f94170d0 (diff) | |
download | src-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/nfs4client')
-rw-r--r-- | sys/nfs4client/nfs4_socket.c | 2 | ||||
-rw-r--r-- | sys/nfs4client/nfs4_vfsops.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/nfs4client/nfs4_socket.c b/sys/nfs4client/nfs4_socket.c index c33bcbb8c885..e5b2ab852954 100644 --- a/sys/nfs4client/nfs4_socket.c +++ b/sys/nfs4client/nfs4_socket.c @@ -298,7 +298,7 @@ nfs4_request_mnt(struct nfsmount *nmp, struct mbuf *mrest, int procnum, error = 0; waituntil = time_second + trylater_delay; while (time_second < waituntil) - (void) tsleep(&lbolt, PSOCK, "nqnfstry", 0); + (void) tsleep(&fake_wchan, PSOCK, "nqnfstry", hz); trylater_delay *= nfs_backoff[trylater_cnt]; if (trylater_cnt < NFS_NBACKOFF - 1) trylater_cnt++; diff --git a/sys/nfs4client/nfs4_vfsops.c b/sys/nfs4client/nfs4_vfsops.c index 2531f6634d3e..d7d853c7201a 100644 --- a/sys/nfs4client/nfs4_vfsops.c +++ b/sys/nfs4client/nfs4_vfsops.c @@ -127,6 +127,8 @@ static vfs_root_t nfs4_root; static vfs_statfs_t nfs4_statfs; static vfs_sync_t nfs4_sync; +static int fake_wchan; + /* * nfs vfs operations. */ @@ -374,7 +376,7 @@ nfs4_decode_args(struct nfsmount *nmp, struct nfs_args *argp) if (nmp->nm_sotype == SOCK_DGRAM) { while (nfs4_connect(nmp)) { printf("nfs4_decode_args: retrying connect\n"); - (void)tsleep(&lbolt, PSOCK, "nfscon", 0); + (void)tsleep(&fake_wchan, PSOCK, "nfscon", hz); } } } |