Lines Matching full:ape

260 audit_pipe_entry_free(struct audit_pipe_entry *ape)  in audit_pipe_entry_free()  argument
263 free(ape->ape_record, M_AUDIT_PIPE_ENTRY); in audit_pipe_entry_free()
264 free(ape, M_AUDIT_PIPE_ENTRY); in audit_pipe_entry_free()
460 struct audit_pipe_entry *ape; in audit_pipe_append() local
470 ape = malloc(sizeof(*ape), M_AUDIT_PIPE_ENTRY, M_NOWAIT | M_ZERO); in audit_pipe_append()
471 if (ape == NULL) { in audit_pipe_append()
477 ape->ape_record = malloc(record_len, M_AUDIT_PIPE_ENTRY, M_NOWAIT); in audit_pipe_append()
478 if (ape->ape_record == NULL) { in audit_pipe_append()
479 free(ape, M_AUDIT_PIPE_ENTRY); in audit_pipe_append()
485 bcopy(record, ape->ape_record, record_len); in audit_pipe_append()
486 ape->ape_record_len = record_len; in audit_pipe_append()
488 TAILQ_INSERT_TAIL(&ap->ap_queue, ape, ape_queue); in audit_pipe_append()
491 ap->ap_qbyteslen += ape->ape_record_len; in audit_pipe_append()
609 struct audit_pipe_entry *ape; in audit_pipe_flush() local
613 while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL) { in audit_pipe_flush()
614 TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue); in audit_pipe_flush()
615 ap->ap_qbyteslen -= ape->ape_record_len; in audit_pipe_flush()
616 audit_pipe_entry_free(ape); in audit_pipe_flush()
899 struct audit_pipe_entry *ape; in audit_pipe_read() local
934 * Note: we rely on the SX lock to maintain ape's stability here. in audit_pipe_read()
937 while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL && in audit_pipe_read()
941 KASSERT(ape->ape_record_len > ap->ap_qoffset, in audit_pipe_read()
943 toread = MIN(ape->ape_record_len - ap->ap_qoffset, in audit_pipe_read()
946 error = uiomove((char *)ape->ape_record + ap->ap_qoffset, in audit_pipe_read()
958 KASSERT(TAILQ_FIRST(&ap->ap_queue) == ape, in audit_pipe_read()
961 KASSERT(ape->ape_record_len >= ap->ap_qoffset, in audit_pipe_read()
963 if (ap->ap_qoffset == ape->ape_record_len) { in audit_pipe_read()
964 TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue); in audit_pipe_read()
965 ap->ap_qbyteslen -= ape->ape_record_len; in audit_pipe_read()
966 audit_pipe_entry_free(ape); in audit_pipe_read()