diff options
author | Eric Biggers <ebiggers@google.com> | 2016-12-03 15:38:29 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-12-03 15:38:29 -0500 |
commit | 97c7b18a5d15516a4358a6d2d5ddfb22d62d9fac (patch) | |
tree | e174a61f84dc532ac99e74afe7b135558db62527 | |
parent | 21d0f4fa8e7b026cdae988f99f4c3aab154d5b7c (diff) | |
download | lwn-97c7b18a5d15516a4358a6d2d5ddfb22d62d9fac.tar.gz lwn-97c7b18a5d15516a4358a6d2d5ddfb22d62d9fac.zip |
mbcache: remove unnecessary module_get/module_put
When mbcache is built as a module, any modules that use it (ext2 and/or
ext4) will depend on its symbols directly, incrementing its reference
count. Therefore, there is no need to do module_get/module_put.
Also note that since the module_get/module_put were in the mbcache
module itself, executing those lines of code was already dependent on
another reference to the mbcache module being held.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/mbcache.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/mbcache.c b/fs/mbcache.c index c56ab2164d6b..07c5d7d2b701 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -344,9 +344,6 @@ struct mb_cache *mb_cache_create(int bucket_bits) int bucket_count = 1 << bucket_bits; int i; - if (!try_module_get(THIS_MODULE)) - return NULL; - cache = kzalloc(sizeof(struct mb_cache), GFP_KERNEL); if (!cache) goto err_out; @@ -377,7 +374,6 @@ struct mb_cache *mb_cache_create(int bucket_bits) return cache; err_out: - module_put(THIS_MODULE); return NULL; } EXPORT_SYMBOL(mb_cache_create); @@ -411,7 +407,6 @@ void mb_cache_destroy(struct mb_cache *cache) } kfree(cache->c_hash); kfree(cache); - module_put(THIS_MODULE); } EXPORT_SYMBOL(mb_cache_destroy); |