From a8753f02eb65acc8490256ae7a632451be68006b Mon Sep 17 00:00:00 2001 From: Aliaksei Karaliou Date: Sat, 23 Dec 2017 14:13:16 +0300 Subject: [PATCH] drivers: lustre: obdclass: simplify unregister_shrinker() usage lu_global_fini() explicitly uses knowledge about shrinker's internals to make decision about calling of unregister_shrinker(). Now this check was integrated into unregister_shrinker(), so it is safe to call it against unregistered shrinker. Signed-off-by: Aliaksei Karaliou Reviewed-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 8e2e6b89e494..2719abbff85f 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -1977,8 +1977,7 @@ int lu_global_init(void) */ void lu_global_fini(void) { - if (lu_site_shrinker.nr_deferred) - unregister_shrinker(&lu_site_shrinker); + unregister_shrinker(&lu_site_shrinker); lu_context_key_degister(&lu_global_key); /* -- 2.30.2