Splitting this trivial stub from the substantial parts in the next patch feels odd. Please merge them.
(and better commit logs and comments really would be useful for others to understand what you've done).
+const struct dma_buf_attach_ops nvme_dmabuf_importer_ops = {
- .move_notify = nvme_dmabuf_move_notify,
- .allow_peer2peer = true,
+};
Tab-align the =, please.
+static int nvme_init_dma_token(struct request_queue *q,
struct blk_mq_dma_token *token)+{
- struct dma_buf_attachment *attach;
- struct nvme_ns *ns = q->queuedata;
- struct nvme_dev *dev = to_nvme_dev(ns->ctrl);
- struct dma_buf *dmabuf = token->dmabuf;
- if (dmabuf->size % NVME_CTRL_PAGE_SIZE)
return -EINVAL;
Why do you care about alignment to the controller page size?
- for_each_sgtable_dma_sg(sgt, sg, tmp) {
dma_addr_t dma = sg_dma_address(sg);unsigned long sg_len = sg_dma_len(sg);while (sg_len) {dma_list[i++] = dma;dma += NVME_CTRL_PAGE_SIZE;sg_len -= NVME_CTRL_PAGE_SIZE;}- }
Why does this build controller pages sized chunks?
linaro-mm-sig@lists.linaro.org