diff options
author | Brian Feldman <green@FreeBSD.org> | 2004-08-02 00:18:36 +0000 |
---|---|---|
committer | Brian Feldman <green@FreeBSD.org> | 2004-08-02 00:18:36 +0000 |
commit | b23f72e98ae8164c07be4b3780a0b83e094844cf (patch) | |
tree | ff53102435294d83e0ddcbd011824aa65f84e3c8 /sys/security | |
parent | 154b8df2ed89bc6ff54310ee54cd720670405ba7 (diff) | |
download | src-b23f72e98ae8164c07be4b3780a0b83e094844cf.tar.gz src-b23f72e98ae8164c07be4b3780a0b83e094844cf.zip |
* 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.
Notes
Notes:
svn path=/head/; revision=132987
Diffstat (limited to 'sys/security')
-rw-r--r-- | sys/security/mac/mac_label.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/security/mac/mac_label.c b/sys/security/mac/mac_label.c index eedc1dfaa3d9..19bd5b06e362 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 |