From 5d3d5a49da9656484920f1db9fff4ff4c05da278 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Tue, 5 Jun 2018 19:38:10 +0200 Subject: [PATCH] nbd: use req.len in NBD_CMD_TRIM Change-Id: I2c193498ae70e2813e5447ac4375c84635f5425a Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/413808 Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- lib/nbd/nbd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/nbd/nbd.c b/lib/nbd/nbd.c index fd9196ae89..7f8eba2358 100644 --- a/lib/nbd/nbd.c +++ b/lib/nbd/nbd.c @@ -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: