diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com> | 2016-11-30 15:29:02 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-12-01 09:58:40 -0500 |
commit | d262920998c891dfd87cf73f823f0ff60e20cdad (patch) | |
tree | 3d612a7f233c8d714d5a23546e767211093fcf7c /drivers/nvme/target/admin-cmd.c | |
parent | 6d31e3ba232ea22458b2f36b6d3f2f9f11bf3fa4 (diff) |
nvmet: add support for the Write Zeroes command
Add support for handling write zeroes command on target.
Call into __blkdev_issue_zeroout, which the block layer expands into the
best suitable variant of zeroing the LBAs. Allow write zeroes operation
to deallocate the LBAs when calling __blkdev_issue_zeroout.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/target/admin-cmd.c')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 7ab9c9381b98..383ea10b97cc 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c | |||
@@ -237,7 +237,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req) | |||
237 | id->maxcmd = cpu_to_le16(NVMET_MAX_CMD); | 237 | id->maxcmd = cpu_to_le16(NVMET_MAX_CMD); |
238 | 238 | ||
239 | id->nn = cpu_to_le32(ctrl->subsys->max_nsid); | 239 | id->nn = cpu_to_le32(ctrl->subsys->max_nsid); |
240 | id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM); | 240 | id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM | |
241 | NVME_CTRL_ONCS_WRITE_ZEROES); | ||
241 | 242 | ||
242 | /* XXX: don't report vwc if the underlying device is write through */ | 243 | /* XXX: don't report vwc if the underlying device is write through */ |
243 | id->vwc = NVME_CTRL_VWC_PRESENT; | 244 | id->vwc = NVME_CTRL_VWC_PRESENT; |