summaryrefslogtreecommitdiff
path: root/fs/aufs/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/module.c')
-rw-r--r--fs/aufs/module.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/fs/aufs/module.c b/fs/aufs/module.c
index 317fde014..88f8f4123 100644
--- a/fs/aufs/module.c
+++ b/fs/aufs/module.c
@@ -26,7 +26,28 @@ void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp)
/*
* aufs caches
*/
-struct kmem_cache *au_cachep[AuCache_Last];
+struct kmem_cache *au_cachep[AuCache_Last] = {
+ [0] = NULL
+};
+
+static void au_cache_fin(void)
+{
+ int i;
+
+ /*
+ * Make sure all delayed rcu free inodes are flushed before we
+ * destroy cache.
+ */
+ rcu_barrier();
+
+ /* excluding AuCache_HNOTIFY */
+ BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last);
+ for (i = 0; i < AuCache_HNOTIFY; i++) {
+ kmem_cache_destroy(au_cachep[i]);
+ au_cachep[i] = NULL;
+ }
+}
+
static int __init au_cache_init(void)
{
au_cachep[AuCache_DINFO] = AuCacheCtor(au_dinfo, au_di_init_once);
@@ -44,27 +65,10 @@ static int __init au_cache_init(void)
if (au_cachep[AuCache_DEHSTR])
return 0;
+ au_cache_fin();
return -ENOMEM;
}
-static void au_cache_fin(void)
-{
- int i;
-
- /*
- * Make sure all delayed rcu free inodes are flushed before we
- * destroy cache.
- */
- rcu_barrier();
-
- /* excluding AuCache_HNOTIFY */
- BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last);
- for (i = 0; i < AuCache_HNOTIFY; i++) {
- kmem_cache_destroy(au_cachep[i]);
- au_cachep[i] = NULL;
- }
-}
-
/* ---------------------------------------------------------------------- */
int au_dir_roflags;
@@ -77,8 +81,6 @@ int au_dir_roflags;
struct au_sphlhead au_sbilist;
#endif
-struct lock_class_key au_lc_key[AuLcKey_Last];
-
/*
* functions for module interface.
*/