]> Pileus Git - ~andy/linux/blobdiff - drivers/vhost/tcm_vhost.c
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
[~andy/linux] / drivers / vhost / tcm_vhost.c
index 6a69bf55aea9462106694ee0a0e3399740a1ac6f..b20df5c829f5036042008d37f6ab20d424e977cd 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/ctype.h>
 #include <linux/compat.h>
 #include <linux/eventfd.h>
-#include <linux/vhost.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <asm/unaligned.h>
@@ -231,7 +230,7 @@ static struct se_node_acl *tcm_vhost_alloc_fabric_acl(
 
        nacl = kzalloc(sizeof(struct tcm_vhost_nacl), GFP_KERNEL);
        if (!nacl) {
-               pr_err("Unable to alocate struct tcm_vhost_nacl\n");
+               pr_err("Unable to allocate struct tcm_vhost_nacl\n");
                return NULL;
        }
 
@@ -415,14 +414,12 @@ static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
 {
        struct tcm_vhost_cmd *tv_cmd;
        struct tcm_vhost_nexus *tv_nexus;
-       struct se_session *se_sess;
 
        tv_nexus = tv_tpg->tpg_nexus;
        if (!tv_nexus) {
                pr_err("Unable to locate active struct tcm_vhost_nexus\n");
                return ERR_PTR(-EIO);
        }
-       se_sess = tv_nexus->tvn_se_sess;
 
        tv_cmd = kzalloc(sizeof(struct tcm_vhost_cmd), GFP_ATOMIC);
        if (!tv_cmd) {
@@ -891,6 +888,7 @@ static int vhost_scsi_release(struct inode *inode, struct file *f)
                vhost_scsi_clear_endpoint(s, &backend);
        }
 
+       vhost_dev_stop(&s->dev);
        vhost_dev_cleanup(&s->dev, false);
        kfree(s);
        return 0;
@@ -966,7 +964,10 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
                return vhost_scsi_set_features(vs, features);
        default:
                mutex_lock(&vs->dev.mutex);
-               r = vhost_dev_ioctl(&vs->dev, ioctl, arg);
+               r = vhost_dev_ioctl(&vs->dev, ioctl, argp);
+               /* TODO: flush backend after dev ioctl. */
+               if (r == -ENOIOCTLCMD)
+                       r = vhost_vring_ioctl(&vs->dev, ioctl, argp);
                mutex_unlock(&vs->dev.mutex);
                return r;
        }