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>
diff --git a/fs/f2fs/crypto_key.c b/fs/f2fs/crypto_key.c
index 5ae9cc8..8a10569 100644
--- a/fs/f2fs/crypto_key.c
+++ b/fs/f2fs/crypto_key.c
@@ -115,11 +115,9 @@
struct user_key_payload *ukp;
int res;
- if (!f2fs_read_workqueue) {
- res = f2fs_init_crypto();
- if (res)
- return res;
- }
+ res = f2fs_crypto_initialize();
+ if (res)
+ return res;
if (fi->i_crypt_info) {
if (!fi->i_crypt_info->ci_keyring_key ||