bdev/raid: Simplify variable name in struct raid_bdev
struct raid_bdev has a pointer raid_bdev_config to its configuration, but raid_bdev is duplicated between raid_bdev and raid_bdev_config and just config may be enough as a name. Change-Id: I77f6a69b913cd540c22f05803c486a4caf103f24 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/422923 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
This commit is contained in:
parent
a74212733b
commit
a4b975244d
@ -162,9 +162,9 @@ raid_bdev_destroy_cb(void *io_device, void *ctx_buf)
|
|||||||
static void
|
static void
|
||||||
raid_bdev_cleanup(struct raid_bdev *raid_bdev)
|
raid_bdev_cleanup(struct raid_bdev *raid_bdev)
|
||||||
{
|
{
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_BDEV_RAID, "raid_bdev_cleanup, %p name %s, state %u, raid_bdev_config %p\n",
|
SPDK_DEBUGLOG(SPDK_LOG_BDEV_RAID, "raid_bdev_cleanup, %p name %s, state %u, config %p\n",
|
||||||
raid_bdev,
|
raid_bdev,
|
||||||
raid_bdev->bdev.name, raid_bdev->state, raid_bdev->raid_bdev_config);
|
raid_bdev->bdev.name, raid_bdev->state, raid_bdev->config);
|
||||||
if (raid_bdev->state == RAID_BDEV_STATE_CONFIGURING) {
|
if (raid_bdev->state == RAID_BDEV_STATE_CONFIGURING) {
|
||||||
TAILQ_REMOVE(&g_spdk_raid_bdev_configuring_list, raid_bdev, link_specific_list);
|
TAILQ_REMOVE(&g_spdk_raid_bdev_configuring_list, raid_bdev, link_specific_list);
|
||||||
} else if (raid_bdev->state == RAID_BDEV_STATE_OFFLINE) {
|
} else if (raid_bdev->state == RAID_BDEV_STATE_OFFLINE) {
|
||||||
@ -178,8 +178,8 @@ raid_bdev_cleanup(struct raid_bdev *raid_bdev)
|
|||||||
assert(raid_bdev->base_bdev_info);
|
assert(raid_bdev->base_bdev_info);
|
||||||
free(raid_bdev->base_bdev_info);
|
free(raid_bdev->base_bdev_info);
|
||||||
raid_bdev->base_bdev_info = NULL;
|
raid_bdev->base_bdev_info = NULL;
|
||||||
if (raid_bdev->raid_bdev_config) {
|
if (raid_bdev->config) {
|
||||||
raid_bdev->raid_bdev_config->raid_bdev = NULL;
|
raid_bdev->config->raid_bdev = NULL;
|
||||||
}
|
}
|
||||||
free(raid_bdev);
|
free(raid_bdev);
|
||||||
}
|
}
|
||||||
@ -1218,7 +1218,7 @@ raid_bdev_create(struct raid_bdev_config *raid_cfg, struct raid_bdev **_raid_bde
|
|||||||
|
|
||||||
raid_bdev->strip_size = raid_cfg->strip_size;
|
raid_bdev->strip_size = raid_cfg->strip_size;
|
||||||
raid_bdev->state = RAID_BDEV_STATE_CONFIGURING;
|
raid_bdev->state = RAID_BDEV_STATE_CONFIGURING;
|
||||||
raid_bdev->raid_bdev_config = raid_cfg;
|
raid_bdev->config = raid_cfg;
|
||||||
TAILQ_INSERT_TAIL(&g_spdk_raid_bdev_configuring_list, raid_bdev, link_specific_list);
|
TAILQ_INSERT_TAIL(&g_spdk_raid_bdev_configuring_list, raid_bdev, link_specific_list);
|
||||||
TAILQ_INSERT_TAIL(&g_spdk_raid_bdev_list, raid_bdev, link_global_list);
|
TAILQ_INSERT_TAIL(&g_spdk_raid_bdev_list, raid_bdev, link_global_list);
|
||||||
|
|
||||||
@ -1306,7 +1306,7 @@ raid_bdev_configure(struct raid_bdev *raid_bdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
raid_bdev_gen = &raid_bdev->bdev;
|
raid_bdev_gen = &raid_bdev->bdev;
|
||||||
raid_bdev_gen->name = strdup(raid_bdev->raid_bdev_config->name);
|
raid_bdev_gen->name = strdup(raid_bdev->config->name);
|
||||||
if (!raid_bdev_gen->name) {
|
if (!raid_bdev_gen->name) {
|
||||||
SPDK_ERRLOG("Unable to allocate name for raid\n");
|
SPDK_ERRLOG("Unable to allocate name for raid\n");
|
||||||
goto offline;
|
goto offline;
|
||||||
|
@ -93,7 +93,7 @@ struct raid_bdev {
|
|||||||
TAILQ_ENTRY(raid_bdev) link_global_list;
|
TAILQ_ENTRY(raid_bdev) link_global_list;
|
||||||
|
|
||||||
/* pointer to config file entry */
|
/* pointer to config file entry */
|
||||||
struct raid_bdev_config *raid_bdev_config;
|
struct raid_bdev_config *config;
|
||||||
|
|
||||||
/* array of base bdev info */
|
/* array of base bdev info */
|
||||||
struct raid_base_bdev_info *base_bdev_info;
|
struct raid_base_bdev_info *base_bdev_info;
|
||||||
|
@ -828,7 +828,7 @@ verify_raid_bdev(struct rpc_construct_raid_bdev *r, bool presence, uint32_t raid
|
|||||||
if (presence == false) {
|
if (presence == false) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CU_ASSERT(pbdev->raid_bdev_config->raid_bdev == pbdev);
|
CU_ASSERT(pbdev->config->raid_bdev == pbdev);
|
||||||
CU_ASSERT(pbdev->base_bdev_info != NULL);
|
CU_ASSERT(pbdev->base_bdev_info != NULL);
|
||||||
CU_ASSERT(pbdev->strip_size == ((r->strip_size * 1024) / g_block_len));
|
CU_ASSERT(pbdev->strip_size == ((r->strip_size * 1024) / g_block_len));
|
||||||
CU_ASSERT(pbdev->strip_size_shift == spdk_u32log2(((r->strip_size * 1024) / g_block_len)));
|
CU_ASSERT(pbdev->strip_size_shift == spdk_u32log2(((r->strip_size * 1024) / g_block_len)));
|
||||||
|
Loading…
Reference in New Issue
Block a user