Convert from timeout to callout API.

Submitted by: rwatson
This commit is contained in:
Alexander Kabaev 2004-03-07 16:28:31 +00:00
parent bc9d2845f4
commit fa3d2a12df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126723
3 changed files with 5 additions and 4 deletions

View File

@ -132,7 +132,7 @@ struct uio;
struct vattr;
struct nameidata;
extern struct callout_handle nfsrv_timer_handle;
extern struct callout nfsrv_callout;
extern struct nfsrvstats nfsrvstats;
extern int nfsrv_ticks;

View File

@ -96,7 +96,7 @@ SYSCTL_INT(_vfs_nfsrv, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count,
*/
#define NFS_CWNDSCALE 256
#define NFS_MAXCWND (NFS_CWNDSCALE * 32)
struct callout_handle nfsrv_timer_handle;
struct callout nfsrv_callout;
static void nfs_realign(struct mbuf **pm, int hsiz); /* XXX SHARED */
static int nfsrv_getstream(struct nfssvc_sock *, int);
@ -779,5 +779,5 @@ nfsrv_timer(void *arg)
nfsrv_wakenfsd(slp);
}
splx(s);
nfsrv_timer_handle = timeout(nfsrv_timer, NULL, nfsrv_ticks);
callout_reset(&nfsrv_callout, nfsrv_ticks, nfsrv_timer, NULL);
}

View File

@ -545,6 +545,7 @@ nfsrv_modevent(module_t mod, int type, void *data)
nfsrv_init(0); /* Init server data structures */
nfsrv_initcache(); /* Init the server request cache */
callout_init(&nfsrv_callout, 0);
nfsrv_timer(0);
nfs_prev_nfssvc_sy_narg = sysent[SYS_nfssvc].sy_narg;
@ -555,7 +556,7 @@ nfsrv_modevent(module_t mod, int type, void *data)
case MOD_UNLOAD:
untimeout(nfsrv_timer, (void *)NULL, nfsrv_timer_handle);
callout_stop(&nfsrv_callout);
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
break;