summaryrefslogtreecommitdiff
path: root/fs/mbcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/mbcache.c')
-rw-r--r--fs/mbcache.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/mbcache.c b/fs/mbcache.c
index e60a840999aa..2a6319b4072c 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -358,16 +358,14 @@ struct mb_cache *mb_cache_create(int bucket_bits)
unsigned long bucket_count = 1UL << bucket_bits;
unsigned long i;
- cache = kzalloc(sizeof(struct mb_cache), GFP_KERNEL);
+ cache = kzalloc_obj(struct mb_cache);
if (!cache)
goto err_out;
cache->c_bucket_bits = bucket_bits;
cache->c_max_entries = bucket_count << 4;
INIT_LIST_HEAD(&cache->c_list);
spin_lock_init(&cache->c_list_lock);
- cache->c_hash = kmalloc_array(bucket_count,
- sizeof(struct hlist_bl_head),
- GFP_KERNEL);
+ cache->c_hash = kmalloc_objs(struct hlist_bl_head, bucket_count);
if (!cache->c_hash) {
kfree(cache);
goto err_out;
@@ -408,6 +406,7 @@ void mb_cache_destroy(struct mb_cache *cache)
{
struct mb_cache_entry *entry, *next;
+ cancel_work_sync(&cache->c_shrink_work);
shrinker_free(cache->c_shrink);
/*