summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_acct.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-11-27 22:52:31 +0000
committerjake <jake@FreeBSD.org>2000-11-27 22:52:31 +0000
commit9326f655fcd4caf90e69a0e773ed128fe10e8996 (patch)
tree81303d866925ac21a87e7c5eb42a74a8327dafc2 /sys/kern/kern_acct.c
parent79bed97f3ef08feeef87c05d8ecd1eb1a6c486e4 (diff)
downloadFreeBSD-src-9326f655fcd4caf90e69a0e773ed128fe10e8996.zip
FreeBSD-src-9326f655fcd4caf90e69a0e773ed128fe10e8996.tar.gz
Use callout_reset instead of timeout(9). Most callouts are statically
allocated, 2 have been added to struct proc for setitimer and sleep. Reviewed by: jhb, jlemon
Diffstat (limited to 'sys/kern/kern_acct.c')
-rw-r--r--sys/kern/kern_acct.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index ff982e0..8f4ae90 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -77,11 +77,9 @@ static comp_t encode_comp_t __P((u_long, u_long));
static void acctwatch __P((void *));
/*
- * Accounting callout handle used for periodic scheduling of
- * acctwatch.
+ * Accounting callout used for periodic scheduling of acctwatch.
*/
-static struct callout_handle acctwatch_handle
- = CALLOUT_HANDLE_INITIALIZER(&acctwatch_handle);
+static struct callout acctwatch_callout;
/*
* Accounting vnode pointer, and saved vnode pointer.
@@ -148,7 +146,7 @@ acct(a1, uap)
* close the file, and (if no new file was specified, leave).
*/
if (acctp != NULLVP || savacctp != NULLVP) {
- untimeout(acctwatch, NULL, acctwatch_handle);
+ callout_stop(&acctwatch_callout);
error = vn_close((acctp != NULLVP ? acctp : savacctp), FWRITE,
p->p_ucred, p);
acctp = savacctp = NULLVP;
@@ -161,6 +159,7 @@ acct(a1, uap)
* free space watcher.
*/
acctp = nd.ni_vp;
+ callout_init(&acctwatch_callout, 0);
acctwatch(NULL);
return (error);
}
@@ -329,5 +328,5 @@ acctwatch(a)
log(LOG_NOTICE, "Accounting suspended\n");
}
}
- acctwatch_handle = timeout(acctwatch, NULL, acctchkfreq * hz);
+ callout_reset(&acctwatch_callout, acctchkfreq * hz, acctwatch, NULL);
}
OpenPOWER on IntegriCloud