summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_label.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-08-02 00:18:36 +0000
committergreen <green@FreeBSD.org>2004-08-02 00:18:36 +0000
commit9532ab7116a36e60ae15ec463c757a7d2e7f9b39 (patch)
treeff53102435294d83e0ddcbd011824aa65f84e3c8 /sys/security/mac/mac_label.c
parent14a50c4ac0247a8950847156b4fc16cf935c14ca (diff)
downloadFreeBSD-src-9532ab7116a36e60ae15ec463c757a7d2e7f9b39.zip
FreeBSD-src-9532ab7116a36e60ae15ec463c757a7d2e7f9b39.tar.gz
* Add a "how" argument to uma_zone constructors and initialization functions
so that they know whether the allocation is supposed to be able to sleep or not. * Allow uma_zone constructors and initialation functions to return either success or error. Almost all of the ones in the tree currently return success unconditionally, but mbuf is a notable exception: the packet zone constructor wants to be able to fail if it cannot suballocate an mbuf cluster, and the mbuf allocators want to be able to fail in general in a MAC kernel if the MAC mbuf initializer fails. This fixes the panics people are seeing when they run out of memory for mbuf clusters. * Allow debug.nosleepwithlocks on WITNESS to be disabled, without changing the default. Both bmilekic and jeff have reviewed the changes made to make failable zone allocations work.
Diffstat (limited to 'sys/security/mac/mac_label.c')
-rw-r--r--sys/security/mac/mac_label.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/security/mac/mac_label.c b/sys/security/mac/mac_label.c
index eedc1df..19bd5b0 100644
--- a/sys/security/mac/mac_label.c
+++ b/sys/security/mac/mac_label.c
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
uma_zone_t zone_label;
-static void mac_labelzone_ctor(void *mem, int size, void *arg);
+static int mac_labelzone_ctor(void *mem, int size, void *arg, int flags);
static void mac_labelzone_dtor(void *mem, int size, void *arg);
void
@@ -57,8 +57,8 @@ mac_labelzone_init(void)
UMA_ALIGN_PTR, 0);
}
-static void
-mac_labelzone_ctor(void *mem, int size, void *arg)
+static int
+mac_labelzone_ctor(void *mem, int size, void *arg, int flags)
{
struct label *label;
@@ -66,6 +66,7 @@ mac_labelzone_ctor(void *mem, int size, void *arg)
label = mem;
bzero(label, sizeof(*label));
label->l_flags = MAC_FLAG_INITIALIZED;
+ return (0);
}
static void
OpenPOWER on IntegriCloud