client_obd_cleanup() can never fail and it always returns
0. Make the function return void instead and fix all of the
callers.
Test-Parameters: trivial
Fixes:
911b6167a37c ("LU-3810 obd: Cleanup client import if client_obd_setup fail")
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I5a5987b4fafb712c35943620235620c6370a9f76
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58761
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Vandana Rungta <vrungta@amazon.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
* @{
*/
int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
-int client_obd_cleanup(struct obd_device *obd);
+void client_obd_cleanup(struct obd_device *obd);
int client_connect_import(const struct lu_env *env,
struct obd_export **exp, struct obd_device *obd,
struct obd_uuid *cluuid, struct obd_connect_data *ocd,
}
EXPORT_SYMBOL(client_obd_setup);
-int client_obd_cleanup(struct obd_device *obd)
+void client_obd_cleanup(struct obd_device *obd)
{
struct client_obd *cli = &obd->u.cli;
BITS_TO_LONGS(OBD_MAX_RIF_MAX) * sizeof(long));
cli->cl_mod_tag_bitmap = NULL;
- RETURN(0);
+ EXIT;
}
EXPORT_SYMBOL(client_obd_cleanup);
static int mgc_cleanup(struct obd_device *obd)
{
- int rc;
-
ENTRY;
/* COMPAT_146 - old config logs may have added profiles secretly */
lprocfs_obd_cleanup(obd);
ptlrpcd_decref();
- rc = client_obd_cleanup(obd);
- RETURN(rc);
+ client_obd_cleanup(obd);
+ RETURN(0);
}
static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
int osc_cleanup_common(struct obd_device *obd)
{
struct client_obd *cli = &obd->u.cli;
- int rc;
ENTRY;
/* free memory of osc quota cache */
osc_quota_cleanup(obd);
-
- rc = client_obd_cleanup(obd);
-
+ client_obd_cleanup(obd);
ptlrpcd_decref();
- RETURN(rc);
+ RETURN(0);
}
EXPORT_SYMBOL(osc_cleanup_common);
static struct lu_device *lwp_device_fini(const struct lu_env *env,
struct lu_device *ludev)
{
- struct lwp_device *m = lu2lwp_dev(ludev);
- struct task_struct *task = NULL;
- int rc;
+ struct lwp_device *m = lu2lwp_dev(ludev);
+ struct task_struct *task = NULL;
+
ENTRY;
task = xchg(&m->lpd_notify_task, NULL);
class_disconnect(m->lpd_exp);
LASSERT(m->lpd_obd);
- rc = client_obd_cleanup(m->lpd_obd);
- LASSERTF(rc == 0, "error %d\n", rc);
-
+ client_obd_cleanup(m->lpd_obd);
ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
-
ptlrpcd_decref();
-
RETURN(NULL);
}
struct lu_device *ld)
{
struct osp_device *osp = lu2osp_dev(ld);
- int rc;
ENTRY;
* the obd devices are already gone.
*/
osp_tunables_fini(osp);
- rc = client_obd_cleanup(osp->opd_obd);
+ client_obd_cleanup(osp->opd_obd);
ptlrpcd_decref();
-
- RETURN(rc != 0 ? ERR_PTR(rc) : NULL);
+ RETURN(NULL);
}
/**