nbd: use req.len in NBD_CMD_TRIM

Change-Id: I2c193498ae70e2813e5447ac4375c84635f5425a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/413808
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Pawel Wodkowski 2018-06-05 19:38:10 +02:00 committed by Jim Harris
parent 4d58c1328a
commit 5d3d5a49da

View File

@ -67,8 +67,6 @@ struct nbd_io {
enum nbd_io_state_t state;
void *payload;
/* NOTE: for TRIM, this represents number of bytes to trim. */
uint32_t payload_size;
struct nbd_request req;
@ -480,7 +478,7 @@ nbd_submit_bdev_io(struct spdk_nbd_disk *nbd, struct nbd_io *io)
#ifdef NBD_FLAG_SEND_TRIM
case NBD_CMD_TRIM:
rc = spdk_bdev_unmap(desc, ch, from_be64(&io->req.from),
io->payload_size, nbd_io_done, io);
from_be32(&io->req.len), nbd_io_done, io);
break;
#endif
case NBD_CMD_DISC: