1 mbcache: remove unnecessary module_get/module_put
3 From: Eric Biggers <ebiggers@google.com>
5 When mbcache is built as a module, any modules that use it (ext2 and/or
6 ext4) will depend on its symbols directly, incrementing its reference
7 count. Therefore, there is no need to do module_get/module_put.
9 Also note that since the module_get/module_put were in the mbcache
10 module itself, executing those lines of code was already dependent on
11 another reference to the mbcache module being held.
13 Signed-off-by: Eric Biggers <ebiggers@google.com>
14 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 Reviewed-by: Jan Kara <jack@suse.cz>
17 fs/mbcache.c | 5 -----
18 1 file changed, 5 deletions(-)
20 diff --git a/fs/mbcache.c b/fs/mbcache.c
21 index c56ab21..07c5d7d 100644
24 @@ -344,9 +344,6 @@ struct mb_cache *mb_cache_create(int bucket_bits)
25 int bucket_count = 1 << bucket_bits;
28 - if (!try_module_get(THIS_MODULE))
31 cache = kzalloc(sizeof(struct mb_cache), GFP_KERNEL);
34 @@ -377,7 +374,6 @@ struct mb_cache *mb_cache_create(int bucket_bits)
38 - module_put(THIS_MODULE);
41 EXPORT_SYMBOL(mb_cache_create);
42 @@ -411,7 +407,6 @@ void mb_cache_destroy(struct mb_cache *cache)
46 - module_put(THIS_MODULE);
48 EXPORT_SYMBOL(mb_cache_destroy);
51 2.8.0.rc3.226.g39d4020
54 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
55 the body of a message to majordomo@vger.kernel.org
56 More majordomo info at http://vger.kernel.org/majordomo-info.html