vhost/scsi: remove struct vhost_scsi_nacl
authorChristoph Hellwig <hch@lst.de>
Mon, 13 Apr 2015 17:51:12 +0000 (19:51 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 31 May 2015 05:41:50 +0000 (22:41 -0700)
Except for the embedded struct se_node_acl none of the fields were
ever used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/vhost/scsi.c

index 636435b412936dc4ef0723e03b0d9c87afc44392..d21f2ba6c899aab34dfe009be2927574c087a2b7 100644 (file)
@@ -115,15 +115,6 @@ struct vhost_scsi_nexus {
        struct se_session *tvn_se_sess;
 };
 
-struct vhost_scsi_nacl {
-       /* Binary World Wide unique Port Name for Vhost Initiator port */
-       u64 iport_wwpn;
-       /* ASCII formatted WWPN for Sas Initiator port */
-       char iport_name[VHOST_SCSI_NAMELEN];
-       /* Returned by vhost_scsi_make_nodeacl() */
-       struct se_node_acl se_node_acl;
-};
-
 struct vhost_scsi_tpg {
        /* Vhost port target portal group tag for TCM */
        u16 tport_tpgt;
@@ -442,24 +433,14 @@ static int vhost_scsi_check_prot_fabric_only(struct se_portal_group *se_tpg)
 static struct se_node_acl *
 vhost_scsi_alloc_fabric_acl(struct se_portal_group *se_tpg)
 {
-       struct vhost_scsi_nacl *nacl;
-
-       nacl = kzalloc(sizeof(struct vhost_scsi_nacl), GFP_KERNEL);
-       if (!nacl) {
-               pr_err("Unable to allocate struct vhost_scsi_nacl\n");
-               return NULL;
-       }
-
-       return &nacl->se_node_acl;
+       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
 }
 
 static void
 vhost_scsi_release_fabric_acl(struct se_portal_group *se_tpg,
                             struct se_node_acl *se_nacl)
 {
-       struct vhost_scsi_nacl *nacl = container_of(se_nacl,
-                       struct vhost_scsi_nacl, se_node_acl);
-       kfree(nacl);
+       kfree(se_nacl);
 }
 
 static u32 vhost_scsi_tpg_get_inst_index(struct se_portal_group *se_tpg)
@@ -1828,8 +1809,6 @@ vhost_scsi_make_nodeacl(struct se_portal_group *se_tpg,
                       const char *name)
 {
        struct se_node_acl *se_nacl, *se_nacl_new;
-       struct vhost_scsi_nacl *nacl;
-       u64 wwpn = 0;
        u32 nexus_depth;
 
        /* vhost_scsi_parse_wwn(name, &wwpn, 1) < 0)
@@ -1849,21 +1828,14 @@ vhost_scsi_make_nodeacl(struct se_portal_group *se_tpg,
                vhost_scsi_release_fabric_acl(se_tpg, se_nacl_new);
                return se_nacl;
        }
-       /*
-        * Locate our struct vhost_scsi_nacl and set the FC Nport WWPN
-        */
-       nacl = container_of(se_nacl, struct vhost_scsi_nacl, se_node_acl);
-       nacl->iport_wwpn = wwpn;
 
        return se_nacl;
 }
 
 static void vhost_scsi_drop_nodeacl(struct se_node_acl *se_acl)
 {
-       struct vhost_scsi_nacl *nacl = container_of(se_acl,
-                               struct vhost_scsi_nacl, se_node_acl);
        core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1);
-       kfree(nacl);
+       kfree(se_acl);
 }
 
 static void vhost_scsi_free_cmd_map_res(struct vhost_scsi_nexus *nexus,