Commit cfa8a2a9 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf_tgt: save unmap descriptor pointer in request



Avoid accessing the internals of the bdev_io from outside of the bdev
library.

Change-Id: I01dfc38b2520353ad42bcd8587b90f197eadf101
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent eb2ec1b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ struct spdk_nvmf_request {
	void				*data;
	union nvmf_h2c_msg		*cmd;
	union nvmf_c2h_msg		*rsp;
	struct spdk_scsi_unmap_bdesc	*unmap_bdesc;
};

int
+2 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ nvmf_virtual_ctrlr_complete_cmd(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_
	int				sc, sct;

	if (cmd->opc == SPDK_NVME_OPC_DATASET_MANAGEMENT) {
		free(bdev_io->u.unmap.unmap_bdesc);
		free(req->unmap_bdesc);
	}

	spdk_bdev_io_get_nvme_status(bdev_io, &sc, &sct);
@@ -482,6 +482,7 @@ nvmf_virtual_ctrlr_dsm_cmd(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
			response->status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR;
			return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
		}
		req->unmap_bdesc = unmap;
		async = true;
	}