}
 }
 
+void nvme_execute_passthru_rq(struct request *rq)
+{
+       struct nvme_command *cmd = nvme_req(rq)->cmd;
+       struct nvme_ctrl *ctrl = nvme_req(rq)->ctrl;
+       struct nvme_ns *ns = rq->q->queuedata;
+       struct gendisk *disk = ns ? ns->disk : NULL;
+       u32 effects;
+
+       effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
+       blk_execute_rq(rq->q, disk, rq, 0);
+       nvme_passthru_end(ctrl, effects);
+}
+EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
+
 static int nvme_submit_user_cmd(struct request_queue *q,
                struct nvme_command *cmd, void __user *ubuffer,
                unsigned bufflen, void __user *meta_buffer, unsigned meta_len,
                }
        }
 
-       blk_execute_rq(req->q, disk, req, 0);
+       nvme_execute_passthru_rq(req);
        if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
                ret = -EINTR;
        else
        struct nvme_passthru_cmd cmd;
        struct nvme_command c;
        unsigned timeout = 0;
-       u32 effects;
        u64 result;
        int status;
 
        if (cmd.timeout_ms)
                timeout = msecs_to_jiffies(cmd.timeout_ms);
 
-       effects = nvme_passthru_start(ctrl, ns, cmd.opcode);
        status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
                        nvme_to_user_ptr(cmd.addr), cmd.data_len,
                        nvme_to_user_ptr(cmd.metadata), cmd.metadata_len,
                        0, &result, timeout);
-       nvme_passthru_end(ctrl, effects);
 
        if (status >= 0) {
                if (put_user(result, &ucmd->result))
        struct nvme_passthru_cmd64 cmd;
        struct nvme_command c;
        unsigned timeout = 0;
-       u32 effects;
        int status;
 
        if (!capable(CAP_SYS_ADMIN))
        if (cmd.timeout_ms)
                timeout = msecs_to_jiffies(cmd.timeout_ms);
 
-       effects = nvme_passthru_start(ctrl, ns, cmd.opcode);
        status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
                        nvme_to_user_ptr(cmd.addr), cmd.data_len,
                        nvme_to_user_ptr(cmd.metadata), cmd.metadata_len,
                        0, &cmd.result, timeout);
-       nvme_passthru_end(ctrl, effects);
 
        if (status >= 0) {
                if (put_user(cmd.result, &ucmd->result))