fscrypt: remove loadable module related code
Eric Biggers
maintainerPATCH 1/1 fscrypt: remove loadable module related code
From: Eric Biggers <[email protected]>
Since commit 643fa9612bf1 ("fscrypt: remove filesystem specific build config option"), fs/crypto/ can no longer be built as a loadable module. Thus it no longer needs a module_exit function, nor a MODULE_LICENSE. So remove them, and change module_init to late_initcall.
--- fs/crypto/crypto.c | 20 +------------------- fs/crypto/fscrypt_private.h | 2 -- fs/crypto/keyinfo.c | 5 ----- 3 files changed, 1 insertion(+), 26 deletions(-)
fs/crypto/crypto.c +1 -19
@@ -510,22 +510,4 @@ static int __init fscrypt_init(void) fail:return -ENOMEM ; } -module_init (fscrypt_init) - -/** -* fscrypt_exit() - Shutdown the fs encryption system -*/ -static void __exit fscrypt_exit(void) -{ -fscrypt_destroy (); - -if (fscrypt_read_workqueue) -destroy_workqueue (fscrypt_read_workqueue); -kmem_cache_destroy (fscrypt_ctx_cachep); -kmem_cache_destroy (fscrypt_info_cachep); - -fscrypt_essiv_cleanup (); -} -module_exit (fscrypt_exit); - -MODULE_LICENSE ("GPL" ); +late_initcall (fscrypt_init)
fs/crypto/fscrypt_private.h +0 -2
@@ -166,6 +166,4 @@ struct fscrypt_mode { bool needs_essiv; }; -extern void __exit fscrypt_essiv_cleanup(void); -#endif /* _FSCRYPT_PRIVATE_H */
fs/crypto/keyinfo.c +0 -5
@@ -437,11 +437,6 @@ static int init_essiv_generator(struct fscrypt_info *ci, const u8 *raw_key,return err; } -void __exit fscrypt_essiv_cleanup(void) -{ -crypto_free_shash (essiv_hash_tfm); -} -/* * Given the encryption mode and key (normally the derived key, but for * FS_POLICY_FLAG_DIRECT_KEY mode it's the master key), set up the inode's
Signature · 1 line
2.22.0.657.g960e92d24f-goog
Quoted 7 lines · IST Eric Biggers
From: Eric Biggers <[email protected]>
Since commit
643fa9612bf1("fscrypt: remove filesystem specific build config option"),fs/crypto/can no longer be built as a loadable module. Thus it no longer needs amodule_exitfunction, nor aMODULE_LICENSE. So remove them, and changemodule_inittolate_initcall.
Looks good to me,
Quoted 63 lines
Signed-off-by Eric Biggers <[email protected]>--- fs/crypto/crypto.c | 20 +------------------- fs/crypto/fscrypt_private.h | 2 -- fs/crypto/keyinfo.c | 5 ----- 3 files changed, 1 insertion(+), 26 deletions(-)fs/crypto/crypto.c +1
-19@@ -510,22 +510,4 @@ static int __init fscrypt_init(void) fail:return -ENOMEM ; } -module_init (fscrypt_init) - -/** -* fscrypt_exit() - Shutdown the fs encryption system -*/ -static void __exit fscrypt_exit(void) -{ -fscrypt_destroy (); - -if (fscrypt_read_workqueue) -destroy_workqueue (fscrypt_read_workqueue); -kmem_cache_destroy (fscrypt_ctx_cachep); -kmem_cache_destroy (fscrypt_info_cachep); - -fscrypt_essiv_cleanup (); -} -module_exit (fscrypt_exit); - -MODULE_LICENSE ("GPL" ); +late_initcall (fscrypt_init)fs/crypto/fscrypt_private.h +0
-2@@ -166,6 +166,4 @@ struct fscrypt_mode { bool needs_essiv; }; -extern void __exit fscrypt_essiv_cleanup(void); -#endif /* _FSCRYPT_PRIVATE_H */ fs/crypto/keyinfo.c +0
-5@@ -437,11 +437,6 @@ static int init_essiv_generator(struct fscrypt_info *ci, const u8 *raw_key,return err; } -void __exit fscrypt_essiv_cleanup(void) -{ -crypto_free_shash (essiv_hash_tfm); -} -/* * Given the encryption mode and key (normally the derived key, but for * FS_POLICY_FLAG_DIRECT_KEY mode it's the master key), set up the inode's
Signature · 1 line
chandan
Quoted 8 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Since commit
643fa9612bf1("fscrypt: remove filesystem specific build config option"),fs/crypto/can no longer be built as a loadable module. Thus it no longer needs amodule_exitfunction, nor aMODULE_LICENSE. So remove them, and changemodule_inittolate_initcall.Signed-off-by Eric Biggers <[email protected]>
Applied to fscrypt tree for 5.4.
- Eric