From owner-p4-projects Wed May 1 11:39:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1943E37B416; Wed, 1 May 2002 11:39:30 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 40B5737B405 for ; Wed, 1 May 2002 11:39:29 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g41IdTE46463 for perforce@freebsd.org; Wed, 1 May 2002 11:39:29 -0700 (PDT) (envelope-from arr@freebsd.org) Date: Wed, 1 May 2002 11:39:29 -0700 (PDT) Message-Id: <200205011839.g41IdTE46463@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to arr@freebsd.org using -f From: "Andrew R. Reiter" Subject: PERFORCE change 10587 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 +/* + * 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