Date: Wed, 1 May 2002 11:39:29 -0700 (PDT) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 10587 for review Message-ID: <200205011839.g41IdTE46463@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10587 Change 10587 by arr@arr_shibby on 2002/05/01 11:39:22 - Make this compile & add a comment. Affected files ... ... //depot/projects/trustedbsd/audit/sys/kern/kern_audit.c#27 edit ... //depot/projects/trustedbsd/audit/sys/sys/audit.h#17 edit Differences ... ==== //depot/projects/trustedbsd/audit/sys/kern/kern_audit.c#27 (text+ko) ==== @@ -47,6 +47,11 @@ #include <vm/uma.h> +/* + * There might be a need to use another lock besides just audit_mtx + * because of thrashing with the record_queue and memory allocation. + * + */ static struct mtx audit_mtx; static struct audit_record_list record_queue; static uma_zone_t record_zone; @@ -60,6 +65,8 @@ * static size_t pool_size = 32; */ +static __inline void audit_record_enqueue(audit_record_t *); + audit_record_t * audit_record_init(int type, size_t evsz) { @@ -127,9 +134,7 @@ } SYSUNINIT(tbsd_audit, SI_ORDER_ANY, SI_SUB_MAC, &audit_shutdown, NULL); -/* -static __inline -void +static __inline void audit_record_enqueue(audit_record_t *ar) { @@ -137,7 +142,6 @@ TAILQ_INSERT_TAIL(&record_queue, ar, ar_next); mtx_unlock(&audit_mtx); } -*/ int audit_record_write(audit_record_t *ar) @@ -157,7 +161,12 @@ */ for (;;) { ar = NULL; + + /* thrash thrash */ + mtx_lock(&audit_mtx); TAILQ_REMOVE(&record_queue, ar, ar_next); + z = record_zone; + mtx_unlock(&audit_mtx); /* * If we don't exit, we might try to zfree @@ -167,6 +176,7 @@ kthread_exit(0); if (ar) { + printf("audit_write_thread: Record received.\n"); z = record_zone; uma_zfree(z, ar); } ==== //depot/projects/trustedbsd/audit/sys/sys/audit.h#17 (text+ko) ==== @@ -97,11 +97,7 @@ struct audit_header ar_hdr; struct audit_subject ar_subj; struct audit_object ar_obj; - - union audit_evinfo { - struct chmod_info av_chmod; - } ar_evinfo; - + union audit_evinfo ar_evinfo; } audit_record_t; TAILQ_HEAD(audit_record_list, audit_record); @@ -217,6 +213,10 @@ audit_time_t ui_mtime; }; +union audit_evinfo { + struct chown_info av_chown; +}; + void audit_init(void); void audit_shutdown(void); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205011839.g41IdTE46463>