Date: Sun, 21 Apr 2002 21:48:57 -0700 (PDT) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 10120 for review Message-ID: <200204220448.g3M4mvJ83510@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10120 Change 10120 by arr@arr_shibby on 2002/04/21 21:48:19 - Make this compile (Yeesh). Affected files ... ... //depot/projects/trustedbsd/audit/sys/kern/kern_audit.c#23 edit ... //depot/projects/trustedbsd/audit/sys/sys/audit.h#14 edit Differences ... ==== //depot/projects/trustedbsd/audit/sys/kern/kern_audit.c#23 (text+ko) ==== @@ -49,32 +49,31 @@ #define AUDLOG "/var/log/audit" -static __inline audit_record_t *audit_record_alloc(uma_zone_t, u_long *); -static __inline void audit_record_free(audit_record_t *, uma_zone_t, u_long *); +static __inline audit_record_t *audit_record_alloc(uma_zone_t); +static __inline void audit_record_free(audit_record_t *, uma_zone_t); static struct mtx audit_mtx; static struct audit_record_list record_queue; static uma_zone_t record_zone; -static u_long record_leased; static int audit_shutdown_flag = 0; static int audit_id = 0; -static size_t pool_size = 32; +/* readd this later. + static size_t pool_size = 32; + */ static __inline audit_record_t * -audit_record_alloc(uma_zone_t zone, u_long *lease) +audit_record_alloc(uma_zone_t zone) { - *(u_long *)lease++; - return(uma_zalloc(zone)); + return(uma_zalloc(zone, 0)); } static __inline void -audit_record_free(audit_record_t *ar, uma_zone_t zone, u_long *lease) +audit_record_free(audit_record_t *ar, uma_zone_t zone) { - *(u_long *)lease--; uma_zfree(zone, ar); } @@ -84,18 +83,15 @@ audit_record_t *rec; audit_header_t *h; uma_zone_t z; - audit_id_t *id; - u_long *lease; - mtx_lock(&audit_mtx) + mtx_lock(&audit_mtx); z = record_zone; - mtx_unlock(&audit_mtx) + mtx_unlock(&audit_mtx); - rec = audit_record_alloc(z, lease); - bzero(rec, sizeof(*rec)); + rec = audit_record_alloc(z); h = &rec->ar_hdr; h->ah_v = AUDIT_VERSION; - h->ah_id = id++; // prolly should be locked. + h->ah_id = audit_id++; h->ah_len = AUDIT_RECORD_SZ + evsz; h->ah_type = type; nanotime(&h->ah_evtime); @@ -114,8 +110,9 @@ { uma_zone_t zone; - zone = uma_zcreate("AUDIT", &audit_uma_ctor, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); + zone = uma_zcreate("AUDIT", sizeof(audit_record_t), + (uma_ctor)&audit_uma_ctor, + NULL, NULL, NULL, UMA_ALIGN_PTR, 0); if (zone == NULL) panic("audit_init: unable to init audit record zone"); @@ -126,7 +123,7 @@ audit_shutdown_flag = 0; mtx_unlock(&audit_mtx); - (void)kthread_create(&audit_write_thread, ai, NULL, RFNOWAIT, + (void)kthread_create(&audit_write_thread, NULL, NULL, RFNOWAIT, "TrustedBSD audit write thread"); } @@ -146,6 +143,7 @@ } SYSUNINIT(tbsd_audit, SI_ORDER_ANY, SI_SUB_MAC, &audit_shutdown, NULL); +/* static void audit_record_enqueue(audit_record_t *ar) { @@ -154,6 +152,7 @@ TAILQ_INSERT_TAIL(&record_queue, ar, ar_next); mtx_unlock(&audit_mtx); } +*/ int audit_record_write(audit_record_t *ar) @@ -166,7 +165,6 @@ audit_write_thread(void *arg) { audit_record_t *ar; - u_long *lease; uma_zone_t z; /* @@ -182,8 +180,7 @@ if (ar) { z = record_zone; - lease = &record_leased; - audit_record_free(ar, z, lease); + audit_record_free(ar, z); } } } ==== //depot/projects/trustedbsd/audit/sys/sys/audit.h#14 (text+ko) ==== @@ -221,14 +221,14 @@ audit_time_t ui_mtime; }; -void audit_init(int, void *, struct thread *); -void audit_shutdown(int, void *, struct thread *); +void audit_init(void); +void audit_shutdown(void); struct vnode *audit_write_init(const char *, struct thread *, struct ucred **); void audit_write_shutdown(struct vnode *, struct thread *, struct ucred *); -int audit_record_write(audit_record_t *, struct audit_info *, - struct thread *); -audit_record_t *audit_record_init(int, size_t, struct audit_info *); +int audit_record_write(audit_record_t *); +audit_record_t *audit_record_init(int, size_t); void audit_uma_ctor(void *, int); +void audit_write_thread(void *); #endif /* !_SYS_AUDIT_H_ */ 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?200204220448.g3M4mvJ83510>