提交 6904242d 编写于 作者: M Ming Lin 提交者: Jens Axboe

nvme: add helper nvme_cleanup_cmd()

This hides command cleanup into nvme.h and fabrics drivers will
also use it.
Signed-off-by: NMing Lin <ming.l@ssi.samsung.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 f866fc42
......@@ -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) {
......
......@@ -321,8 +321,7 @@ static void nvme_free_iod(struct nvme_dev *dev, struct request *req)
__le64 **list = iod_list(req);
dma_addr_t prp_dma = iod->first_dma;
if (req->cmd_flags & REQ_DISCARD)
kfree(req->completion_data);
nvme_cleanup_cmd(req);
if (iod->npages == 0)
dma_pool_free(dev->prp_small_pool, list[0], prp_dma);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册