summaryrefslogtreecommitdiff
path: root/drivers/nvme/target/io-cmd-file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-10-23 19:35:43 +0300
committerJens Axboe <axboe@kernel.dk>2019-11-04 20:56:42 +0300
commit59ef0eaa7741c3543f98220cc132c61bf0230bce (patch)
tree85452eca466c75c08adf77873130485fbe3705de /drivers/nvme/target/io-cmd-file.c
parent6f86f2c9d94d55c4d3a6f1ffbc2e1115b5cb38a8 (diff)
downloadlinux-59ef0eaa7741c3543f98220cc132c61bf0230bce.tar.xz
nvmet: Introduce nvmet_dsm_len() helper
Similar to the nvmet_rw_len helper. Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> [split patch, update changelog] Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/io-cmd-file.c')
-rw-r--r--drivers/nvme/target/io-cmd-file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 05453f5d1448..7481556da6e6 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -379,8 +379,7 @@ u16 nvmet_file_parse_io_cmd(struct nvmet_req *req)
return 0;
case nvme_cmd_dsm:
req->execute = nvmet_file_execute_dsm;
- req->data_len = (le32_to_cpu(cmd->dsm.nr) + 1) *
- sizeof(struct nvme_dsm_range);
+ req->data_len = nvmet_dsm_len(req);
return 0;
case nvme_cmd_write_zeroes:
req->execute = nvmet_file_execute_write_zeroes;