aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fscache/main.c')
-rw-r--r--fs/fscache/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index c2f3e637725d..48b79d2deac1 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -56,6 +56,18 @@ static int __init fscache_init(void)
56 if (ret < 0) 56 if (ret < 0)
57 goto error_proc; 57 goto error_proc;
58 58
59 fscache_cookie_jar = kmem_cache_create("fscache_cookie_jar",
60 sizeof(struct fscache_cookie),
61 0,
62 0,
63 fscache_cookie_init_once);
64 if (!fscache_cookie_jar) {
65 printk(KERN_NOTICE
66 "FS-Cache: Failed to allocate a cookie jar\n");
67 ret = -ENOMEM;
68 goto error_cookie_jar;
69 }
70
59 fscache_root = kobject_create_and_add("fscache", kernel_kobj); 71 fscache_root = kobject_create_and_add("fscache", kernel_kobj);
60 if (!fscache_root) 72 if (!fscache_root)
61 goto error_kobj; 73 goto error_kobj;
@@ -64,6 +76,8 @@ static int __init fscache_init(void)
64 return 0; 76 return 0;
65 77
66error_kobj: 78error_kobj:
79 kmem_cache_destroy(fscache_cookie_jar);
80error_cookie_jar:
67 fscache_proc_cleanup(); 81 fscache_proc_cleanup();
68error_proc: 82error_proc:
69 slow_work_unregister_user(); 83 slow_work_unregister_user();
@@ -81,6 +95,7 @@ static void __exit fscache_exit(void)
81 _enter(""); 95 _enter("");
82 96
83 kobject_put(fscache_root); 97 kobject_put(fscache_root);
98 kmem_cache_destroy(fscache_cookie_jar);
84 fscache_proc_cleanup(); 99 fscache_proc_cleanup();
85 slow_work_unregister_user(); 100 slow_work_unregister_user();
86 printk(KERN_NOTICE "FS-Cache: Unloaded\n"); 101 printk(KERN_NOTICE "FS-Cache: Unloaded\n");