| 5372 | |
| 5373 | #ifdef INVARIANTS |
| 5374 | static uma_slab_t |
| 5375 | uma_dbg_getslab(uma_zone_t zone, void *item) |
| 5376 | { |
| 5377 | uma_slab_t slab; |
| 5378 | uma_keg_t keg; |
| 5379 | uint8_t *mem; |
| 5380 | |
| 5381 | /* |
| 5382 | * It is safe to return the slab here even though the |
| 5383 | * zone is unlocked because the item's allocation state |
| 5384 | * essentially holds a reference. |
| 5385 | */ |
| 5386 | mem = (uint8_t *)((uintptr_t)item & (~UMA_SLAB_MASK)); |
| 5387 | if ((zone->uz_flags & UMA_ZFLAG_CACHE) != 0) |
| 5388 | return (NULL); |
| 5389 | if (zone->uz_flags & UMA_ZFLAG_VTOSLAB) |
| 5390 | return (vtoslab((vm_offset_t)mem)); |
| 5391 | keg = zone->uz_keg; |
| 5392 | if ((keg->uk_flags & UMA_ZFLAG_HASH) == 0) |
| 5393 | return ((uma_slab_t)(mem + keg->uk_pgoff)); |
| 5394 | KEG_LOCK(keg, 0); |
| 5395 | slab = hash_sfind(&keg->uk_hash, mem); |
| 5396 | KEG_UNLOCK(keg, 0); |
| 5397 | |
| 5398 | return (slab); |
| 5399 | } |
| 5400 | |
| 5401 | static bool |
| 5402 | uma_dbg_zskip(uma_zone_t zone, void *mem) |
no test coverage detected