Skip to content

Commit

Permalink
vhost/scsi: remove struct vhost_scsi_nacl
Browse files Browse the repository at this point in the history
Except for the embedded struct se_node_acl none of the fields were
ever used.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed May 31, 2015
1 parent 1623379 commit 5557011
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions drivers/vhost/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 5557011

Please sign in to comment.