Commit 636b9d59 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

bdev/raid: Simplify variable name in struct raid_base_bdev_config



raid_base_bdev_config is suffciently descriptive as name and so
"name" can be used as the name of the base bdev.

Other structs have used "name" as the name of bdev.

Change-Id: I090ef541a84fd14d9ec3bfebbdc96ae649709551
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/423614


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKunal Sablok <kunal.sablok@intel.com>
parent 897eed31
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -727,7 +727,7 @@ raid_bdev_config_cleanup(struct raid_bdev_config *raid_cfg)

	if (raid_cfg->base_bdev) {
		for (i = 0; i < raid_cfg->num_base_bdevs; i++) {
			free(raid_cfg->base_bdev[i].bdev_name);
			free(raid_cfg->base_bdev[i].name);
		}
		free(raid_cfg->base_bdev);
	}
@@ -849,8 +849,8 @@ raid_bdev_config_add_base_bdev(struct raid_bdev_config *raid_cfg, const char *ba

	TAILQ_FOREACH(tmp, &g_spdk_raid_config.raid_bdev_config_head, link) {
		for (i = 0; i < tmp->num_base_bdevs; i++) {
			if (tmp->base_bdev[i].bdev_name != NULL) {
				if (!strcmp(tmp->base_bdev[i].bdev_name, base_bdev_name)) {
			if (tmp->base_bdev[i].name != NULL) {
				if (!strcmp(tmp->base_bdev[i].name, base_bdev_name)) {
					SPDK_ERRLOG("duplicate base bdev name %s mentioned\n",
						    base_bdev_name);
					return -EEXIST;
@@ -859,8 +859,8 @@ raid_bdev_config_add_base_bdev(struct raid_bdev_config *raid_cfg, const char *ba
		}
	}

	raid_cfg->base_bdev[slot].bdev_name = strdup(base_bdev_name);
	if (raid_cfg->base_bdev[slot].bdev_name == NULL) {
	raid_cfg->base_bdev[slot].name = strdup(base_bdev_name);
	if (raid_cfg->base_bdev[slot].name == NULL) {
		SPDK_ERRLOG("unable to allocate memory\n");
		return -ENOMEM;
	}
@@ -1057,7 +1057,7 @@ raid_bdev_can_claim_bdev(const char *bdev_name, struct raid_bdev_config **_raid_
			 * If match is found then return true and the slot information where
			 * this base bdev should be inserted in raid bdev
			 */
			if (!strcmp(bdev_name, raid_cfg->base_bdev[i].bdev_name)) {
			if (!strcmp(bdev_name, raid_cfg->base_bdev[i].name)) {
				*_raid_cfg = raid_cfg;
				*base_bdev_slot = i;
				rv = true;
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ struct raid_bdev_io {
 */
struct raid_base_bdev_config {
	/* base bdev name from config file */
	char                        *bdev_name;
	char				*name;
};

/*
+1 −1
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ spdk_rpc_destroy_raid_bdev(struct spdk_jsonrpc_request *request, const struct sp

	/* Remove all the base bdevs from this raid bdev before destroying the raid bdev */
	for (uint32_t i = 0; i < raid_cfg->num_base_bdevs; i++) {
		base_bdev = spdk_bdev_get_by_name(raid_cfg->base_bdev[i].bdev_name);
		base_bdev = spdk_bdev_get_by_name(raid_cfg->base_bdev[i].name);
		if (base_bdev != NULL) {
			raid_bdev_remove_base_bdev(base_bdev);
		}
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ verify_raid_config(struct rpc_construct_raid_bdev *r, bool presence)
			CU_ASSERT(raid_cfg->raid_level == r->raid_level);
			if (raid_cfg->base_bdev != NULL) {
				for (i = 0; i < raid_cfg->num_base_bdevs; i++) {
					val = strcmp(raid_cfg->base_bdev[i].bdev_name, r->base_bdevs.base_bdevs[i]);
					val = strcmp(raid_cfg->base_bdev[i].name, r->base_bdevs.base_bdevs[i]);
					CU_ASSERT(val == 0);
				}
			}