void mac_destroy_port_label(struct label *l) { MAC_PERFORM (destroy_port_label, l); mac_destroy_label(l); }
static void mac_labelzone_dtor(void *mem, int size, void *arg) { struct label *label; KASSERT(size == sizeof(*label), ("mac_labelzone_dtor: wrong size\n")); label = mem; mac_destroy_label(label); }
void mac_mbuf_tag_destroy(struct m_tag *tag) { struct label *label; label = (struct label *)(tag+1); MAC_POLICY_PERFORM_NOSLEEP(mbuf_destroy_label, label); mac_destroy_label(label); }
int mac_mbuf_tag_init(struct m_tag *tag, int flag) { struct label *label; int error; label = (struct label *) (tag + 1); mac_init_label(label); if (flag & M_WAITOK) MAC_POLICY_CHECK(mbuf_init_label, label, flag); else MAC_POLICY_CHECK_NOSLEEP(mbuf_init_label, label, flag); if (error) { MAC_POLICY_PERFORM_NOSLEEP(mbuf_destroy_label, label); mac_destroy_label(label); } return (error); }