summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-15 15:37:24 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-06-01 16:20:59 -0700
commitcfc4d971df411c68e27d903f749e0f6fffd9da40 (patch)
tree912d0fe1b1492daf8fe8ff3322092aba8554b4b5 /fs/f2fs/super.c
parentb9da898b05859ac4a0ea4460d798b6bb655790f3 (diff)
f2fs crypto: split f2fs_crypto_init/exit with two parts
This patch splits f2fs_crypto_init/exit with two parts: base initialization and memory allocation. Firstly, f2fs module declares the base encryption memory pointers. Then, allocating internal memories is done at the first encrypted inode access. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index bfc900e87fcc..4f74fee2e2af 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1359,13 +1359,18 @@ static int __init init_f2fs_fs(void)
err = -ENOMEM;
goto free_extent_cache;
}
- err = register_filesystem(&f2fs_fs_type);
+ err = f2fs_init_crypto();
if (err)
goto free_kset;
+ err = register_filesystem(&f2fs_fs_type);
+ if (err)
+ goto free_crypto;
f2fs_create_root_stats();
f2fs_proc_root = proc_mkdir("fs/f2fs", NULL);
return 0;
+free_crypto:
+ f2fs_exit_crypto();
free_kset:
kset_unregister(f2fs_kset);
free_extent_cache:
@@ -1387,6 +1392,7 @@ static void __exit exit_f2fs_fs(void)
remove_proc_entry("fs/f2fs", NULL);
f2fs_destroy_root_stats();
unregister_filesystem(&f2fs_fs_type);
+ f2fs_exit_crypto();
destroy_extent_cache();
destroy_checkpoint_caches();
destroy_segment_manager_caches();