Commit f6763b68 authored by Henri Doreau's avatar Henri Doreau Committed by Greg Kroah-Hartman
Browse files

staging: lustre: obd: Remove dead code in precleanup



There used to be several pre-cleanup phases, but
only OBD_CLEANUP_EXPORTS is actually used.  Thus
remove the whole notion of precleanup phases.

Signed-off-by: default avatarHenri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7034
Reviewed-on: http://review.whamcloud.com/16061


Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 43eb3b33
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -598,13 +598,6 @@ struct obd_device {
	struct completion	obd_kobj_unregister;
};

enum obd_cleanup_stage {
/* Special case hack for MDS LOVs */
	OBD_CLEANUP_EARLY,
/* can be directly mapped to .ldto_device_fini() */
	OBD_CLEANUP_EXPORTS,
};

/* get/set_info keys */
#define KEY_ASYNC	       "async"
#define KEY_CHANGELOG_CLEAR     "changelog_clear"
@@ -751,8 +744,7 @@ struct obd_ops {
			      __u32 vallen, void *val,
			      struct ptlrpc_request_set *set);
	int (*setup)(struct obd_device *dev, struct lustre_cfg *cfg);
	int (*precleanup)(struct obd_device *dev,
			  enum obd_cleanup_stage cleanup_stage);
	int (*precleanup)(struct obd_device *dev);
	int (*cleanup)(struct obd_device *dev);
	int (*process_config)(struct obd_device *dev, u32 len, void *data);
	int (*postrecov)(struct obd_device *dev);
+7 −10
Original line number Diff line number Diff line
@@ -505,8 +505,7 @@ static inline int obd_setup(struct obd_device *obd, struct lustre_cfg *cfg)
	return rc;
}

static inline int obd_precleanup(struct obd_device *obd,
				 enum obd_cleanup_stage cleanup_stage)
static inline int obd_precleanup(struct obd_device *obd)
{
	int rc;
	DECLARE_LU_VARS(ldt, d);
@@ -517,20 +516,18 @@ static inline int obd_precleanup(struct obd_device *obd,
	ldt = obd->obd_type->typ_lu;
	d = obd->obd_lu_dev;
	if (ldt && d) {
		if (cleanup_stage == OBD_CLEANUP_EXPORTS) {
		struct lu_env env;

		rc = lu_env_init(&env, ldt->ldt_ctx_tags);
			if (rc == 0) {
		if (!rc) {
			ldt->ldt_ops->ldto_device_fini(&env, d);
			lu_env_fini(&env);
		}
	}
	}
	OBD_CHECK_DT_OP(obd, precleanup, 0);
	OBD_COUNTER_INCREMENT(obd, precleanup);

	rc = OBP(obd, precleanup)(obd, cleanup_stage);
	rc = OBP(obd, precleanup)(obd);
	return rc;
}

+3 −16
Original line number Diff line number Diff line
@@ -2623,23 +2623,10 @@ try_next_stripe:
	goto retry_unlink;
}

static int lmv_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
static int lmv_precleanup(struct obd_device *obd)
{
	struct lmv_obd *lmv = &obd->u.lmv;

	switch (stage) {
	case OBD_CLEANUP_EARLY:
		/* XXX: here should be calling obd_precleanup() down to
		 * stack.
		 */
		break;
	case OBD_CLEANUP_EXPORTS:
		fld_client_debugfs_fini(&lmv->lmv_fld);
	fld_client_debugfs_fini(&obd->u.lmv.lmv_fld);
	lprocfs_obd_cleanup(obd);
		break;
	default:
		break;
	}
	return 0;
}

+0 −24
Original line number Diff line number Diff line
@@ -825,29 +825,6 @@ out:
	return rc;
}

static int lov_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
{
	struct lov_obd *lov = &obd->u.lov;

	switch (stage) {
	case OBD_CLEANUP_EARLY: {
		int i;

		for (i = 0; i < lov->desc.ld_tgt_count; i++) {
			if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active)
				continue;
			obd_precleanup(class_exp2obd(lov->lov_tgts[i]->ltd_exp),
				       OBD_CLEANUP_EARLY);
		}
		break;
	}
	default:
		break;
	}

	return 0;
}

static int lov_cleanup(struct obd_device *obd)
{
	struct lov_obd *lov = &obd->u.lov;
@@ -1399,7 +1376,6 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
static struct obd_ops lov_obd_ops = {
	.owner          = THIS_MODULE,
	.setup          = lov_setup,
	.precleanup     = lov_precleanup,
	.cleanup        = lov_cleanup,
	/*.process_config       = lov_process_config,*/
	.connect        = lov_connect,
+8 −15
Original line number Diff line number Diff line
@@ -2660,12 +2660,8 @@ static int mdc_init_ea_size(struct obd_export *exp, u32 easize, u32 def_easize)
	return 0;
}

static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
static int mdc_precleanup(struct obd_device *obd)
{
	switch (stage) {
	case OBD_CLEANUP_EARLY:
		break;
	case OBD_CLEANUP_EXPORTS:
	/* Failsafe, ok if racy */
	if (obd->obd_type->typ_refcnt <= 1)
		libcfs_kkuc_group_rem(0, KUC_GRP_HSM);
@@ -2673,10 +2669,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
	obd_cleanup_client_import(obd);
	ptlrpc_lprocfs_unregister_obd(obd);
	lprocfs_obd_cleanup(obd);

	mdc_llog_finish(obd);
		break;
	}
	return 0;
}

Loading