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