summaryrefslogtreecommitdiffstats
path: root/sys/security/audit/audit.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-06-05 13:43:57 +0000
committerrwatson <rwatson@FreeBSD.org>2006-06-05 13:43:57 +0000
commit4f92724562aeddd68892b2f2902f15196fb15aa3 (patch)
treee2581f585ccf82344e263c87925295b69eb2e7d6 /sys/security/audit/audit.c
parent20a9b30021810cb9d9be3ea013ee19b5cec7b704 (diff)
downloadFreeBSD-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/audit.c')
-rw-r--r--sys/security/audit/audit.c20
1 files changed, 9 insertions, 11 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);
}
OpenPOWER on IntegriCloud