From 16ffcf7f06ae04ebcfe2debabebe36265cb44dae Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Wed, 16 Apr 2025 04:31:46 +0000 Subject: [PATCH] LU-18162 llite: consolidate cl_stack_fini()/lu_stack_fini() lu_stack_fini() is only called by cl_stack_fini(), which is simply a thin wrapper around the former. Consolidate these two functions by deleting cl_stack_fini(). Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: I42e9b5310c50dc2362fc5ef83b2a10bed09becea Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58810 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Reviewed-by: Alex Zhuravlev --- lustre/include/cl_object.h | 1 - lustre/llite/vvp_dev.c | 2 +- lustre/lov/lov_dev.c | 6 +++--- lustre/obdclass/cl_object.c | 9 --------- lustre/obdclass/lu_object.c | 1 + 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index ba3cc6b..c672249 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2056,7 +2056,6 @@ struct cl_site { int cl_site_init(struct cl_site *s, struct cl_device *top); void cl_site_fini(struct cl_site *s); -void cl_stack_fini(const struct lu_env *env, struct cl_device *cl); /** * Output client site statistical counters into a buffer. Suitable for diff --git a/lustre/llite/vvp_dev.c b/lustre/llite/vvp_dev.c index 186e852..90df045 100644 --- a/lustre/llite/vvp_dev.c +++ b/lustre/llite/vvp_dev.c @@ -352,7 +352,7 @@ int cl_sb_fini(struct super_block *sb) cld = sbi->ll_cl; if (cld != NULL) { - cl_stack_fini(env, cld); + lu_stack_fini(env, cl2lu_dev(cld)); sbi->ll_cl = NULL; sbi->ll_site = NULL; } diff --git a/lustre/lov/lov_dev.c b/lustre/lov/lov_dev.c index 0352ea3..f5cab73 100644 --- a/lustre/lov/lov_dev.c +++ b/lustre/lov/lov_dev.c @@ -204,7 +204,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env, if (!ld->ld_md_tgts[i].ldm_mdc) continue; - cl_stack_fini(env, ld->ld_md_tgts[i].ldm_mdc); + lu_stack_fini(env, cl2lu_dev(ld->ld_md_tgts[i].ldm_mdc)); ld->ld_md_tgts[i].ldm_mdc = NULL; ld->ld_lov->lov_mdc_tgts[i].lmtd_mdc = NULL; } @@ -218,7 +218,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env, lsd = ld->ld_target[desc->ltd_index]; if (lsd) { - cl_stack_fini(env, lovsub2cl_dev(lsd)); + lu_stack_fini(env, lovsub2lu_dev(lsd)); ld->ld_target[desc->ltd_index] = NULL; } } @@ -338,7 +338,7 @@ static void lov_cl_del_target(const struct lu_env *env, struct lu_device *dev, ENTRY; if (ld->ld_target[index]) { - cl_stack_fini(env, lovsub2cl_dev(ld->ld_target[index])); + lu_stack_fini(env, lovsub2lu_dev(ld->ld_target[index])); ld->ld_target[index] = NULL; } EXIT; diff --git a/lustre/obdclass/cl_object.c b/lustre/obdclass/cl_object.c index 287fdaa..857c5a7 100644 --- a/lustre/obdclass/cl_object.c +++ b/lustre/obdclass/cl_object.c @@ -1040,15 +1040,6 @@ struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site, } EXPORT_SYMBOL(cl_type_setup); -/** - * Finalize device stack by calling lu_stack_fini(). - */ -void cl_stack_fini(const struct lu_env *env, struct cl_device *cl) -{ - lu_stack_fini(env, cl2lu_dev(cl)); -} -EXPORT_SYMBOL(cl_stack_fini); - static struct lu_context_key cl_key; struct cl_thread_info *cl_env_info(const struct lu_env *env) diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 032711d..b77dec4 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1351,6 +1351,7 @@ void lu_stack_fini(const struct lu_env *env, struct lu_device *top) for (scan = top; scan != NULL; scan = next) next = ldto_device_free(env, scan); } +EXPORT_SYMBOL(lu_stack_fini); /** * Global counter incremented whenever key is registered, unregistered, -- 1.8.3.1