diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2003-06-25 17:25:45 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2003-06-25 17:25:45 +0000 |
commit | 2763308887088708176584204d5acb795c03ebf6 (patch) | |
tree | 365f150a222acaff21dfdafcd4b39ae47eed8465 /sys | |
parent | 4321847dfe0c2d30620e62df01a7a46e0101377e (diff) | |
download | FreeBSD-src-2763308887088708176584204d5acb795c03ebf6.zip FreeBSD-src-2763308887088708176584204d5acb795c03ebf6.tar.gz |
Make sure that the zone destructor doesn't get called twice in
certain free paths.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/uma_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index ac86b27..a602249 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1671,8 +1671,10 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata) uma_bucket_t bucket; int bflags; int cpu; + int skip; /* This is the fast path free */ + skip = 0; #ifdef UMA_DEBUG_ALLOC_1 printf("Freeing item %p to %s(%p)\n", item, zone->uz_name, zone); #endif @@ -1684,8 +1686,10 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata) if (zone->uz_flags & UMA_ZFLAG_FULL) goto zfree_internal; - if (zone->uz_dtor) + if (zone->uz_dtor) { zone->uz_dtor(item, zone->uz_size, udata); + skip = 1; + } zfree_restart: cpu = PCPU_GET(cpuid); @@ -1800,7 +1804,7 @@ zfree_start: zfree_internal: - uma_zfree_internal(zone, item, udata, 0); + uma_zfree_internal(zone, item, udata, skip); return; |