Commit 15b441cd authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre: Remove IS_SERVER and all users



Since the client can never be server, this is all dead code.

Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bea5820d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -180,8 +180,6 @@ struct lustre_disk_data {
#define IS_MDT(data)    ((data)->lsi_flags & LDD_F_SV_TYPE_MDT)
#define IS_OST(data)    ((data)->lsi_flags & LDD_F_SV_TYPE_OST)
#define IS_MGS(data)    ((data)->lsi_flags & LDD_F_SV_TYPE_MGS)
#define IS_SERVER(data) ((data)->lsi_flags & (LDD_F_SV_TYPE_MGS | \
			 LDD_F_SV_TYPE_MDT | LDD_F_SV_TYPE_OST))
#define MT_STR(data)    mt_str((data)->ldd_mount_type)

/* Make the mdt/ost server obd name based on the filesystem name */
+6 −30
Original line number Diff line number Diff line
@@ -263,14 +263,8 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd,
	 * where only clients are notified if one of cmd server restarts */
	LASSERT(strlen(fsname) < sizeof(logname) / 2);
	strcpy(logname, fsname);
	if (IS_SERVER(lsi)) { /* mdt */
		LASSERT(lcfg.cfg_instance == NULL);
		lcfg.cfg_instance = sb;
		strcat(logname, "-mdtir");
	} else {
		LASSERT(lcfg.cfg_instance != NULL);
	LASSERT(lcfg.cfg_instance);
	strcat(logname, "-cliir");
	}

	cld = do_config_log_add(obd, logname, CONFIG_T_RECOVER, &lcfg, sb);
	return cld;
@@ -899,12 +893,6 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
	req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0);
	ptlrpc_request_set_replen(req);

	/* check if this is server or client */
	if (cld->cld_cfg.cfg_sb) {
		struct lustre_sb_info *lsi = s2lsi(cld->cld_cfg.cfg_sb);
		if (lsi && IS_SERVER(lsi))
			short_limit = 1;
	}
	/* Limit how long we will wait for the enqueue to complete */
	req->rq_delay_limit = short_limit ? 5 : MGC_ENQUEUE_LIMIT;
	rc = ldlm_cli_enqueue(exp, &req, &einfo, &cld->cld_resid, NULL, flags,
@@ -1112,7 +1100,6 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
				  void *data, int datalen, bool mne_swab)
{
	struct config_llog_instance *cfg = &cld->cld_cfg;
	struct lustre_sb_info       *lsi = s2lsi(cfg->cfg_sb);
	struct mgs_nidtbl_entry *entry;
	struct lustre_cfg       *lcfg;
	struct lustre_cfg_bufs   bufs;
@@ -1131,22 +1118,11 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
	if (!inst)
		return -ENOMEM;

	if (!IS_SERVER(lsi)) {
	pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance);
	if (pos >= PAGE_CACHE_SIZE) {
		kfree(inst);
		return -E2BIG;
	}
	} else {
		LASSERT(IS_MDT(lsi));
		rc = server_name2svname(lsi->lsi_svname, inst, NULL,
					PAGE_CACHE_SIZE);
		if (rc) {
			kfree(inst);
			return -EINVAL;
		}
		pos = strlen(inst);
	}

	++pos;
	buf   = inst + pos;
+14 −71
Original line number Diff line number Diff line
@@ -216,29 +216,10 @@ int lustre_start_mgc(struct super_block *sb)

	LASSERT(lsi->lsi_lmd);

	/* Find the first non-lo MGS nid for our MGC name */
	if (IS_SERVER(lsi)) {
		/* mount -o mgsnode=nid */
		ptr = lsi->lsi_lmd->lmd_mgs;
		if (lsi->lsi_lmd->lmd_mgs &&
		    (class_parse_nid(lsi->lsi_lmd->lmd_mgs, &nid, &ptr) == 0)) {
			i++;
		} else if (IS_MGS(lsi)) {
			lnet_process_id_t id;
			while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
				if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
					continue;
				nid = id.nid;
				i++;
				break;
			}
		}
	} else { /* client */
	/* Use nids from mount line: uml1,1@elan:uml2,2@elan:/lustre */
	ptr = lsi->lsi_lmd->lmd_dev;
	if (class_parse_nid(ptr, &nid, &ptr) == 0)
		i++;
	}
	if (i == 0) {
		CERROR("No valid MGS nids found.\n");
		return -EINVAL;
@@ -326,35 +307,6 @@ int lustre_start_mgc(struct super_block *sb)

	/* Add the primary nids for the MGS */
	i = 0;
	if (IS_SERVER(lsi)) {
		ptr = lsi->lsi_lmd->lmd_mgs;
		if (IS_MGS(lsi)) {
			/* Use local nids (including LO) */
			lnet_process_id_t id;
			while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
				rc = do_lcfg(mgcname, id.nid,
					     LCFG_ADD_UUID, niduuid,
					     NULL, NULL, NULL);
			}
		} else {
			/* Use mgsnode= nids */
			/* mount -o mgsnode=nid */
			if (lsi->lsi_lmd->lmd_mgs) {
				ptr = lsi->lsi_lmd->lmd_mgs;
			} else if (class_find_param(ptr, PARAM_MGSNODE,
						    &ptr) != 0) {
				CERROR("No MGS nids given.\n");
				rc = -EINVAL;
				goto out_free;
			}
			while (class_parse_nid(ptr, &nid, &ptr) == 0) {
				rc = do_lcfg(mgcname, nid,
					     LCFG_ADD_UUID, niduuid,
					     NULL, NULL, NULL);
				i++;
			}
		}
	} else { /* client */
	/* Use nids from mount line: uml1,1@elan:uml2,2@elan:/lustre */
	ptr = lsi->lsi_lmd->lmd_dev;
	while (class_parse_nid(ptr, &nid, &ptr) == 0) {
@@ -365,7 +317,6 @@ int lustre_start_mgc(struct super_block *sb)
		if (*ptr == ':')
			break;
	}
	}
	if (i == 0) {
		CERROR("No valid MGS nids found.\n");
		rc = -EINVAL;
@@ -610,14 +561,6 @@ int lustre_put_lsi(struct super_block *sb)

	CDEBUG(D_MOUNT, "put %p %d\n", sb, atomic_read(&lsi->lsi_mounts));
	if (atomic_dec_and_test(&lsi->lsi_mounts)) {
		if (IS_SERVER(lsi) && lsi->lsi_osd_exp) {
			lu_device_put(&lsi->lsi_dt_dev->dd_lu_dev);
			lsi->lsi_osd_exp->exp_obd->obd_lvfs_ctxt.dt = NULL;
			lsi->lsi_dt_dev = NULL;
			obd_disconnect(lsi->lsi_osd_exp);
			/* wait till OSD is gone */
			obd_zombie_barrier();
		}
		lustre_free_lsi(sb);
		return 1;
	}
@@ -1267,7 +1210,7 @@ static void lustre_kill_super(struct super_block *sb)
{
	struct lustre_sb_info *lsi = s2lsi(sb);

	if (kill_super_cb && lsi && !IS_SERVER(lsi))
	if (kill_super_cb && lsi)
		(*kill_super_cb)(sb);

	kill_anon_super(sb);