Commit d1394291 authored by Jinlong Chen's avatar Jinlong Chen Committed by Jim Harris
Browse files

bdev: simplify bdev_reset_freeze_channel



Commit 055de83a "bdev: multiple QoS queues with atomic-based QoS quota"
removed locking around swapping qos_queued_io, but forgot to remove the
swapping. Let's remove it to simplify bdev_reset_freeze_channel.

Change-Id: I48c1b7e09e7d92450bc2d91a2adefa26d072af52
Signed-off-by: default avatarJinlong Chen <chenjinlong.cjl@alibaba-inc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25521


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarGangCao <gang.cao@intel.com>
parent 0edc184e
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -6917,9 +6917,6 @@ bdev_reset_freeze_channel(struct spdk_bdev_channel_iter *i, struct spdk_bdev *bd
	struct spdk_bdev_channel	*channel;
	struct spdk_bdev_mgmt_channel	*mgmt_channel;
	struct spdk_bdev_shared_resource *shared_resource;
	bdev_io_tailq_t			tmp_queued;

	TAILQ_INIT(&tmp_queued);

	channel = __io_ch_to_bdev_ch(ch);
	shared_resource = channel->shared_resource;
@@ -6927,13 +6924,12 @@ bdev_reset_freeze_channel(struct spdk_bdev_channel_iter *i, struct spdk_bdev *bd

	channel->flags |= BDEV_CH_RESET_IN_PROGRESS;

	if ((channel->flags & BDEV_CH_QOS_ENABLED) != 0) {
		TAILQ_SWAP(&channel->qos_queued_io, &tmp_queued, spdk_bdev_io, internal.link);
	}

	bdev_abort_all_queued_io(&shared_resource->nomem_io, channel);
	bdev_abort_all_buf_io(mgmt_channel, channel);
	bdev_abort_all_queued_io(&tmp_queued, channel);

	if ((channel->flags & BDEV_CH_QOS_ENABLED) != 0) {
		bdev_abort_all_queued_io(&channel->qos_queued_io, channel);
	}

	spdk_bdev_for_each_channel_continue(i, 0);
}