md/raid5: simplify uninitialization of shrinker

Don't use shrinker.nr_deferred to check whether shrinker was
initialized or not. Now this check was integrated into
unregister_shrinker(), so it is safe to call it against
unregistered shrinker.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Shaohua Li <sh.li@alibaba-inc.com>
This commit is contained in:
Aliaksei Karaliou 2017-12-23 21:20:31 +03:00 committed by Shaohua Li
parent c786427f57
commit 565e045012

View File

@ -6764,9 +6764,7 @@ static void free_conf(struct r5conf *conf)
log_exit(conf);
if (conf->shrinker.nr_deferred)
unregister_shrinker(&conf->shrinker);
unregister_shrinker(&conf->shrinker);
free_thread_groups(conf);
shrink_stripes(conf);
raid5_free_percpu(conf);