| 360 | static struct list_head kmem_list; |
| 361 | |
| 362 | static kmem_debug_t * |
| 363 | kmem_del_init(spinlock_t *lock, struct hlist_head *table, |
| 364 | int bits, const void *addr) |
| 365 | { |
| 366 | struct hlist_head *head; |
| 367 | struct hlist_node *node = NULL; |
| 368 | struct kmem_debug *p; |
| 369 | unsigned long flags; |
| 370 | |
| 371 | spin_lock_irqsave(lock, flags); |
| 372 | |
| 373 | head = &table[hash_ptr((void *)addr, bits)]; |
| 374 | hlist_for_each(node, head) { |
| 375 | p = list_entry(node, struct kmem_debug, kd_hlist); |
| 376 | if (p->kd_addr == addr) { |
| 377 | hlist_del_init(&p->kd_hlist); |
| 378 | list_del_init(&p->kd_list); |
| 379 | spin_unlock_irqrestore(lock, flags); |
| 380 | return (p); |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | spin_unlock_irqrestore(lock, flags); |
| 385 | |
| 386 | return (NULL); |
| 387 | } |
| 388 | |
| 389 | inline void * |
| 390 | spl_kmem_alloc_track(size_t size, int flags, |
no test coverage detected