From 30f275bb51052e65e8026d2e1d80eb711f88f029 Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 19 Sep 2003 08:37:44 +0000 Subject: - Fix the silly flag situation in UMA. Remove redundant ZFLAG/ZONE flags by accepting the user supplied flags directly. Previously this was not done so that flags for the same field would not be defined in two different files. Add comments in each header instructing future developers on how now to shoot their feet. - Fix a test for !OFFPAGE which should have been a test for HASH. This would have caused a panic if we had ever destructed a malloc zone. This also opens up the possibility that other zones could use the vsetobj() method rather than a hash. --- sys/vm/uma_int.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sys/vm/uma_int.h') diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index f7550a7..1c6bfae 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -247,17 +247,13 @@ struct uma_zone { #define UMA_CACHE_INC 16 /* How much will we move data */ -#define UMA_ZFLAG_OFFPAGE 0x0001 /* Struct slab/freelist off page */ -#define UMA_ZFLAG_PRIVALLOC 0x0002 /* Zone has supplied it's own alloc */ -#define UMA_ZFLAG_INTERNAL 0x0004 /* Internal zone, no offpage no PCPU */ -#define UMA_ZFLAG_MALLOC 0x0008 /* Zone created by malloc */ -#define UMA_ZFLAG_NOFREE 0x0010 /* Don't free data from this zone */ -#define UMA_ZFLAG_FULL 0x0020 /* This zone reached uz_maxpages */ -#define UMA_ZFLAG_CACHEONLY 0x0040 /* Don't go to VM to allocate internal objs */ -#define UMA_ZFLAG_HASH 0x0080 /* Look up slab via hash */ - -/* This lives in uflags */ -#define UMA_ZONE_INTERNAL 0x1000 /* Internal zone for uflags */ +/* + * These flags must not overlap with the UMA_ZONE flags specified in uma.h. + */ +#define UMA_ZFLAG_PRIVALLOC 0x1000 /* Use uz_allocf. */ +#define UMA_ZFLAG_INTERNAL 0x2000 /* No offpage no PCPU. */ +#define UMA_ZFLAG_FULL 0x4000 /* Reached uz_maxpages */ +#define UMA_ZFLAG_CACHEONLY 0x8000 /* Don't ask VM for buckets. */ /* Internal prototypes */ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, u_int8_t *data); -- cgit v1.1