Commit 935c0b47 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

bdev/raid: Remove unnecessary check in raid_bdev_remove_base_bdev



The condition that both raid_bdev and raid_bdev->base_bdev_info[i].bdev
are not NULL is already verified by matching it with base_bdev.

This is a preparation to the further refactoring in the next patch.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPiotr Pelpliński <piotr.pelplinski@intel.com>
parent e9344656
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1481,14 +1481,11 @@ raid_bdev_remove_base_bdev(void *ctx)
		return;
	}

	assert(raid_bdev != NULL);
	assert(raid_bdev->base_bdev_info[i].bdev);
	assert(raid_bdev->base_bdev_info[i].desc);
	raid_bdev->base_bdev_info[i].remove_scheduled = true;

	if ((raid_bdev->destruct_called == true ||
	     raid_bdev->state == RAID_BDEV_STATE_CONFIGURING) &&
	    raid_bdev->base_bdev_info[i].bdev != NULL) {
	if (raid_bdev->destruct_called == true ||
	    raid_bdev->state == RAID_BDEV_STATE_CONFIGURING) {
		/*
		 * As raid bdev is not registered yet or already unregistered, so cleanup
		 * should be done here itself