Date: Wed, 8 May 2002 12:44:11 -0700 (PDT) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 11021 for review Message-ID: <200205081944.g48JiB366457@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11021 Change 11021 by arr@arr_shibby on 2002/05/08 12:43:29 - Rewrite AUDIT_RECORD_ENQ into _audit_record_enq. - Change event time to a void * for the time being. - Change audit_write_thread to take an opaque pointer as an argument. Affected files ... ... //depot/projects/trustedbsd/audit/sys/sys/audit.h#30 edit Differences ... ==== //depot/projects/trustedbsd/audit/sys/sys/audit.h#30 (text+ko) ==== @@ -44,6 +44,8 @@ #include <sys/proc.h> #include <sys/sysctl.h> #include <sys/uio.h> +#include <sys/bus.h> +#include <sys/interrupt.h> #include <vm/vm_zone.h> @@ -57,7 +59,11 @@ typedef u_char audit_status_t; typedef u_char audit_object_type_t; typedef void * audit_event_info_t; -typedef struct timespec audit_time_t; +typedef void * audit_time_t; + +extern struct mtx audit_q_mtx; +extern struct audit_record_list record_queue; +extern void *audit_h; #define AUDIT_RECORD_SZ (AUDIT_OBJ_LEN + AUDIT_SUBJ_LEN + AUDIT_HDR_LEN) @@ -104,16 +110,6 @@ #define AUDIT_SET_OBJECT_KPATH(obj, kpath) \ copystr((kpath), (obj)->ao_name, sizeof(obj)->ao_name, NULL) -extern struct mtx audit_q_mtx; -extern struct audit_record_list record_queue; - -#define AUDIT_RECORD_ENQ(ar) do { \ - mtx_lock(&audit_q_mtx); \ - TAILQ_INSERT_TAIL(&record_queue, (ar), ar_next); \ - mtx_unlock(&audit_q_mtx); \ - wakeup_one(&record_queue); \ -} while (0) - struct chmod_info { char ci_path[MAXPATHLEN]; mode_t ci_mode; @@ -234,12 +230,9 @@ printf("---[ HEADER ]---\n" "-[ Version: %u, Record ID: %u\n" "-[ Result: %s, errno: %d\n", - "-[ Time event occured: %x\n", ahp->ah_v, ahp->ah_id, - AUDIT_EV_RESULT(ahp->ah_evresult), ahp->ah_errno, - ahp->ah_evtime); + AUDIT_EV_RESULT(ahp->ah_evresult), ahp->ah_errno); } - typedef struct audit_subject { uid_t as_euid; /* Effective UID */ @@ -312,12 +305,25 @@ printf("----------------------------------------------------------\n"); } + +static __inline +void +_audit_record_enq(audit_record_t *ar) +{ + + mtx_lock(&audit_q_mtx); + TAILQ_INSERT_TAIL(&record_queue, ar, ar_next); + mtx_unlock(&audit_q_mtx); + swi_sched(audit_h, 0); +} + + 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 *); audit_record_t *audit_record_init(int, size_t); -void audit_write_thread(void); +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?200205081944.g48JiB366457>