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>
This commit is contained in:
committed by
Jens Axboe
parent
6d31e3ba23
commit
d262920998
@@ -237,7 +237,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
|
||||
|
||||
id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
|
||||
id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM);
|
||||
id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM |
|
||||
NVME_CTRL_ONCS_WRITE_ZEROES);
|
||||
|
||||
/* XXX: don't report vwc if the underlying device is write through */
|
||||
id->vwc = NVME_CTRL_VWC_PRESENT;
|
||||
|
||||
Reference in New Issue
Block a user