Lines Matching defs:ape
258 audit_pipe_entry_free(struct audit_pipe_entry *ape)
261 free(ape->ape_record, M_AUDIT_PIPE_ENTRY);
262 free(ape, M_AUDIT_PIPE_ENTRY);
458 struct audit_pipe_entry *ape;
468 ape = malloc(sizeof(*ape), M_AUDIT_PIPE_ENTRY, M_NOWAIT | M_ZERO);
469 if (ape == NULL) {
475 ape->ape_record = malloc(record_len, M_AUDIT_PIPE_ENTRY, M_NOWAIT);
476 if (ape->ape_record == NULL) {
477 free(ape, M_AUDIT_PIPE_ENTRY);
483 bcopy(record, ape->ape_record, record_len);
484 ape->ape_record_len = record_len;
486 TAILQ_INSERT_TAIL(&ap->ap_queue, ape, ape_queue);
489 ap->ap_qbyteslen += ape->ape_record_len;
616 struct audit_pipe_entry *ape;
620 while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL) {
621 TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue);
622 ap->ap_qbyteslen -= ape->ape_record_len;
623 audit_pipe_entry_free(ape);
966 struct audit_pipe_entry *ape;
1000 * Note: we rely on the sleep lock to maintain ape's stability here.
1003 while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL &&
1007 KASSERT(ape->ape_record_len > ap->ap_qoffset,
1009 toread = MIN(ape->ape_record_len - ap->ap_qoffset,
1012 error = uiomove((char *)ape->ape_record + ap->ap_qoffset,
1024 KASSERT(TAILQ_FIRST(&ap->ap_queue) == ape,
1027 KASSERT(ape->ape_record_len >= ap->ap_qoffset,
1029 if (ap->ap_qoffset == ape->ape_record_len) {
1030 TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue);
1031 ap->ap_qbyteslen -= ape->ape_record_len;
1032 audit_pipe_entry_free(ape);