summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorMing Lin2016-04-25 23:33:20 +0200
committerJens Axboe2016-05-02 17:11:58 +0200
commit6904242db1ac07403c331b18796f6c2bf5382aec (patch)
treef185d0bf1e52827df0e6c5f23eea595e91f6dc25 /drivers/nvme/host/nvme.h
parentnvme: move AER handling to common code (diff)
downloadkernel-qcow2-linux-6904242db1ac07403c331b18796f6c2bf5382aec.tar.gz
kernel-qcow2-linux-6904242db1ac07403c331b18796f6c2bf5382aec.tar.xz
kernel-qcow2-linux-6904242db1ac07403c331b18796f6c2bf5382aec.zip
nvme: add helper nvme_cleanup_cmd()
This hides command cleanup into nvme.h and fabrics drivers will also use it. Signed-off-by: Ming Lin <ming.l@ssi.samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 631a11e15b7c..114b92873894 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -182,6 +182,12 @@ static inline unsigned nvme_map_len(struct request *rq)
return blk_rq_bytes(rq);
}
+static inline void nvme_cleanup_cmd(struct request *req)
+{
+ if (req->cmd_flags & REQ_DISCARD)
+ kfree(req->completion_data);
+}
+
static inline int nvme_error_status(u16 status)
{
switch (status & 0x7ff) {