Commit 4fe9536d authored by Ben Walker's avatar Ben Walker
Browse files

bdev: Remove reset_type



There is now just one type of reset, which is equivalent
to a HARD reset previously.

Change-Id: I955b219cbc5c25793d97de1cc003b30ae99313ac
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362615


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 239ba69c
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -84,23 +84,6 @@ enum spdk_bdev_io_type {
	SPDK_BDEV_IO_TYPE_RESET,
};

/** Blockdev reset operation type */
enum spdk_bdev_reset_type {
	/**
	 * A hard reset indicates that the blockdev layer should not
	 *  invoke the completion callback for I/Os issued before the
	 *  reset is issued but completed after the reset is complete.
	 */
	SPDK_BDEV_RESET_HARD,

	/**
	 * A soft reset indicates that the blockdev layer should still
	 *  invoke the completion callback for I/Os issued before the
	 *  reset is issued but completed after the reset is complete.
	 */
	SPDK_BDEV_RESET_SOFT,
};

/**
 * Block device completion callback
 *
@@ -233,7 +216,7 @@ struct spdk_bdev_io *spdk_bdev_flush(struct spdk_bdev *bdev, struct spdk_io_chan
				     spdk_bdev_io_completion_cb cb, void *cb_arg);
int spdk_bdev_free_io(struct spdk_bdev_io *bdev_io);
int spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
		    enum spdk_bdev_reset_type, spdk_bdev_io_completion_cb cb, void *cb_arg);
		    spdk_bdev_io_completion_cb cb, void *cb_arg);
struct spdk_io_channel *spdk_bdev_get_io_channel(struct spdk_bdev *bdev);

/**
+0 −3
Original line number Diff line number Diff line
@@ -285,9 +285,6 @@ struct spdk_bdev_io {
			/** Represents the number of bytes to be flushed, starting at offset. */
			uint64_t length;
		} flush;
		struct {
			enum spdk_bdev_reset_type type;
		} reset;
	} u;

	/** Status for the IO */
+2 −6
Original line number Diff line number Diff line
@@ -912,7 +912,6 @@ spdk_bdev_flush(struct spdk_bdev *bdev, struct spdk_io_channel *ch,

int
spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
		enum spdk_bdev_reset_type reset_type,
		spdk_bdev_io_completion_cb cb, void *cb_arg)
{
	struct spdk_bdev_io *bdev_io;
@@ -928,7 +927,6 @@ spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch,

	bdev_io->ch = channel;
	bdev_io->type = SPDK_BDEV_IO_TYPE_RESET;
	bdev_io->u.reset.type = reset_type;
	spdk_bdev_io_init(bdev_io, bdev, cb_arg, cb);

	rc = spdk_bdev_io_submit(bdev_io);
@@ -1006,11 +1004,9 @@ spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status sta
	if (bdev_io->type == SPDK_BDEV_IO_TYPE_RESET) {
		/* Successful reset */
		if (status == SPDK_BDEV_IO_STATUS_SUCCESS) {
			/* Increase the blockdev generation if it is a hard reset */
			if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) {
			/* Increase the blockdev generation */
			bdev_io->bdev->gencnt++;
		}
		}
	} else {
		/*
		 * Check the gencnt, to see if this I/O was issued before the most
+1 −3
Original line number Diff line number Diff line
@@ -78,10 +78,8 @@ vbdev_error_reset(struct vbdev_error_disk *error_disk, struct spdk_bdev_io *bdev
	 * since the spdk_bdev_io_complete() path that normally updates it will not execute
	 * after we resubmit the I/O to the base_bdev.
	 */
	if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) {
	error_disk->disk.gencnt++;
}
}

static void
vbdev_error_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
+1 −3
Original line number Diff line number Diff line
@@ -104,10 +104,8 @@ split_reset(struct split_disk *split_disk, struct spdk_bdev_io *bdev_io)
	 * since the spdk_bdev_io_complete() path that normally updates it will not execute
	 * after we resubmit the I/O to the base_bdev.
	 */
	if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) {
	split_disk->disk.gencnt++;
}
}

static void
vbdev_split_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
Loading