diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-06-05 13:43:57 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-06-05 13:43:57 +0000 |
commit | 4f92724562aeddd68892b2f2902f15196fb15aa3 (patch) | |
tree | e2581f585ccf82344e263c87925295b69eb2e7d6 /sys/security/audit | |
parent | 20a9b30021810cb9d9be3ea013ee19b5cec7b704 (diff) | |
download | FreeBSD-src-4f92724562aeddd68892b2f2902f15196fb15aa3.zip FreeBSD-src-4f92724562aeddd68892b2f2902f15196fb15aa3.tar.gz |
Rename audit_cv to audit_worker_cv, as it wakes up the audit
worker.
Rename audit_commit_cv to audit_watermark_cv, since it is there to
wake up threads waiting on hitting the low watermark. Describe
properly in comment.
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security/audit')
-rw-r--r-- | sys/security/audit/audit.c | 20 | ||||
-rw-r--r-- | sys/security/audit/audit_private.h | 4 | ||||
-rw-r--r-- | sys/security/audit/audit_worker.c | 6 |
3 files changed, 14 insertions, 16 deletions
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index bf3f4ca..4f343e8 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -136,16 +136,14 @@ struct au_qctrl audit_qctrl; * either new records are in the queue, or a log replacement is taking * place. */ -struct cv audit_cv; +struct cv audit_worker_cv; /* - * Condition variable to signal to the worker that it has work to do: - * either new records are in the queue, or a log replacement is taking - * place. - * - * XXXRW: This description is incorrect. + * Condition variable to flag when crossing the low watermark, meaning that + * threads blocked due to hitting the high watermark can wake up and continue + * to commit records. */ -struct cv audit_commit_cv; +struct cv audit_watermark_cv; /* * Condition variable for auditing threads wait on when in fail-stop mode. @@ -239,8 +237,8 @@ audit_init(void) audit_qctrl.aq_minfree = AU_FS_MINFREE; mtx_init(&audit_mtx, "audit_mtx", NULL, MTX_DEF); - cv_init(&audit_cv, "audit_cv"); - cv_init(&audit_commit_cv, "audit_commit_cv"); + cv_init(&audit_worker_cv, "audit_worker_cv"); + cv_init(&audit_watermark_cv, "audit_watermark_cv"); cv_init(&audit_fail_cv, "audit_fail_cv"); audit_record_zone = uma_zcreate("audit_record_zone", @@ -427,7 +425,7 @@ audit_commit(struct kaudit_record *ar, int error, int retval) while (audit_q_len >= audit_qctrl.aq_hiwater) { AUDIT_PRINTF(("audit_commit: sleeping to wait for " "audit queue to drain below high water mark\n")); - cv_wait(&audit_commit_cv, &audit_mtx); + cv_wait(&audit_watermark_cv, &audit_mtx); AUDIT_PRINTF(("audit_commit: woke up waiting for " "audit queue draining\n")); } @@ -435,7 +433,7 @@ audit_commit(struct kaudit_record *ar, int error, int retval) TAILQ_INSERT_TAIL(&audit_q, ar, k_q); audit_q_len++; audit_pre_q_len--; - cv_signal(&audit_cv); + cv_signal(&audit_worker_cv); mtx_unlock(&audit_mtx); } diff --git a/sys/security/audit/audit_private.h b/sys/security/audit/audit_private.h index e8ae41e..543bb60 100644 --- a/sys/security/audit/audit_private.h +++ b/sys/security/audit/audit_private.h @@ -269,8 +269,8 @@ void kau_init(void); * be abstracted so that only accessor methods are exposed. */ extern struct mtx audit_mtx; -extern struct cv audit_commit_cv; -extern struct cv audit_cv; +extern struct cv audit_watermark_cv; +extern struct cv audit_worker_cv; extern struct kaudit_queue audit_q; extern int audit_q_len; extern int audit_pre_q_len; diff --git a/sys/security/audit/audit_worker.c b/sys/security/audit/audit_worker.c index 97ea66f..7da4f99 100644 --- a/sys/security/audit/audit_worker.c +++ b/sys/security/audit/audit_worker.c @@ -420,7 +420,7 @@ audit_worker(void *arg) */ while (!audit_replacement_flag && TAILQ_EMPTY(&audit_q)) { AUDIT_PRINTF(("audit_worker waiting\n")); - cv_wait(&audit_cv, &audit_mtx); + cv_wait(&audit_worker_cv, &audit_mtx); AUDIT_PRINTF(("audit_worker woken up\n")); AUDIT_PRINTF(("audit_worker: new vp = %p; value of " "flag %d\n", audit_replacement_vp, @@ -460,7 +460,7 @@ audit_worker(void *arg) TAILQ_INSERT_TAIL(&ar_worklist, ar, k_q); } if (lowater_signal) - cv_broadcast(&audit_commit_cv); + cv_broadcast(&audit_watermark_cv); mtx_unlock(&audit_mtx); while ((ar = TAILQ_FIRST(&ar_worklist))) { @@ -525,7 +525,7 @@ audit_rotate_vnode(struct ucred *cred, struct vnode *vp) * Wake up the audit worker to perform the exchange once we * release the mutex. */ - cv_signal(&audit_cv); + cv_signal(&audit_worker_cv); /* * Wait for the audit_worker to broadcast that a replacement has |