Commit d29ec824 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme: submit internal commands through the block layer

Use block layer queues with an internal cmd_type to submit internally
generated NVMe commands.  This both simplifies the code a lot and allow
for a better structure.  For example now the LighNVM code can construct
commands without knowing the details of the underlying I/O descriptors.
Or a future NVMe over network target could inject commands, as well as
could the SCSI translation and ioctl code be reused for such a beast.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 772ce435
This diff is collapsed.
This diff is collapsed.
...@@ -146,21 +146,15 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector) ...@@ -146,21 +146,15 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
return (sector >> (ns->lba_shift - 9)); return (sector >> (ns->lba_shift - 9));
} }
/** int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
* nvme_free_iod - frees an nvme_iod void *buf, unsigned bufflen);
* @dev: The device that the I/O was submitted to int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
* @iod: The memory to free void *buffer, void __user *ubuffer, unsigned bufflen,
*/ u32 *result, unsigned timeout);
void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); int nvme_identify_ctrl(struct nvme_dev *dev, struct nvme_id_ctrl **id);
int nvme_identify_ns(struct nvme_dev *dev, unsigned nsid,
int nvme_setup_prps(struct nvme_dev *, struct nvme_iod *, int, gfp_t); struct nvme_id_ns **id);
struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, int nvme_get_log_page(struct nvme_dev *dev, struct nvme_smart_log **log);
unsigned long addr, unsigned length);
void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
struct nvme_iod *iod);
int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd);
int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns,
dma_addr_t dma_addr);
int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
dma_addr_t dma_addr, u32 *result); dma_addr_t dma_addr, u32 *result);
int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment