Skip to content

Commit 63263d6

Browse files
Keith BuschChristoph Hellwig
authored andcommitted
nvme: Use metadata for passthrough commands
The ioctls' struct allows the user to provide a metadata address and length for a passthrough command. This patch uses these values that were previously ignored and deletes the now unused wrapper function. Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 485783c commit 63263d6

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static void *nvme_add_user_metadata(struct bio *bio, void __user *ubuf,
634634
return ERR_PTR(ret);
635635
}
636636

637-
static int __nvme_submit_user_cmd(struct request_queue *q,
637+
static int nvme_submit_user_cmd(struct request_queue *q,
638638
struct nvme_command *cmd, void __user *ubuffer,
639639
unsigned bufflen, void __user *meta_buffer, unsigned meta_len,
640640
u32 meta_seed, u32 *result, unsigned timeout)
@@ -690,14 +690,6 @@ static int __nvme_submit_user_cmd(struct request_queue *q,
690690
return ret;
691691
}
692692

693-
static int nvme_submit_user_cmd(struct request_queue *q, struct nvme_command *cmd,
694-
void __user *ubuffer, unsigned bufflen, u32 *result,
695-
unsigned timeout)
696-
{
697-
return __nvme_submit_user_cmd(q, cmd, ubuffer, bufflen, NULL, 0, 0,
698-
result, timeout);
699-
}
700-
701693
static void nvme_keep_alive_end_io(struct request *rq, blk_status_t status)
702694
{
703695
struct nvme_ctrl *ctrl = rq->end_io_data;
@@ -987,7 +979,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
987979
c.rw.apptag = cpu_to_le16(io.apptag);
988980
c.rw.appmask = cpu_to_le16(io.appmask);
989981

990-
return __nvme_submit_user_cmd(ns->queue, &c,
982+
return nvme_submit_user_cmd(ns->queue, &c,
991983
(void __user *)(uintptr_t)io.addr, length,
992984
metadata, meta_len, io.slba, NULL, 0);
993985
}
@@ -1025,7 +1017,8 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
10251017

10261018
status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
10271019
(void __user *)(uintptr_t)cmd.addr, cmd.data_len,
1028-
&cmd.result, timeout);
1020+
(void __user *)(uintptr_t)cmd.metadata, cmd.metadata,
1021+
0, &cmd.result, timeout);
10291022
if (status >= 0) {
10301023
if (put_user(cmd.result, &ucmd->result))
10311024
return -EFAULT;

0 commit comments

Comments
 (0)