diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -3326,43 +3326,6 @@ size_t ksize(const void *object) | |||
3326 | } | 3326 | } |
3327 | EXPORT_SYMBOL(ksize); | 3327 | EXPORT_SYMBOL(ksize); |
3328 | 3328 | ||
3329 | #ifdef CONFIG_SLUB_DEBUG | ||
3330 | bool verify_mem_not_deleted(const void *x) | ||
3331 | { | ||
3332 | struct page *page; | ||
3333 | void *object = (void *)x; | ||
3334 | unsigned long flags; | ||
3335 | bool rv; | ||
3336 | |||
3337 | if (unlikely(ZERO_OR_NULL_PTR(x))) | ||
3338 | return false; | ||
3339 | |||
3340 | local_irq_save(flags); | ||
3341 | |||
3342 | page = virt_to_head_page(x); | ||
3343 | if (unlikely(!PageSlab(page))) { | ||
3344 | /* maybe it was from stack? */ | ||
3345 | rv = true; | ||
3346 | goto out_unlock; | ||
3347 | } | ||
3348 | |||
3349 | slab_lock(page); | ||
3350 | if (on_freelist(page->slab_cache, page, object)) { | ||
3351 | object_err(page->slab_cache, page, object, | ||
3352 | "Object is on free-list"); | ||
3353 | rv = false; | ||
3354 | } else { | ||
3355 | rv = true; | ||
3356 | } | ||
3357 | slab_unlock(page); | ||
3358 | |||
3359 | out_unlock: | ||
3360 | local_irq_restore(flags); | ||
3361 | return rv; | ||
3362 | } | ||
3363 | EXPORT_SYMBOL(verify_mem_not_deleted); | ||
3364 | #endif | ||
3365 | |||
3366 | void kfree(const void *x) | 3329 | void kfree(const void *x) |
3367 | { | 3330 | { |
3368 | struct page *page; | 3331 | struct page *page; |