Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173644
b: refs/heads/master
c: 8622196
h: refs/heads/master
v: v3
  • Loading branch information
Chris Leech authored and James Bottomley committed Dec 4, 2009
1 parent 7856af6 commit eb30a17
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93e6d5ab9969a9200752658677eafd96772302f0
refs/heads/master: 86221969e20a2f60ce104160dc836a964974673b
8 changes: 3 additions & 5 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,6 @@ static int fcoe_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
int rc = 0;

/* lport scsi host config */
lp->host = shost;

lp->host->max_lun = FCOE_MAX_LUN;
lp->host->max_id = FCOE_MAX_FCP_TARGET;
lp->host->max_channel = 0;
Expand Down Expand Up @@ -734,14 +732,14 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,

FCOE_NETDEV_DBG(netdev, "Create Interface\n");

shost = libfc_host_alloc(&fcoe_shost_template,
lport = libfc_host_alloc(&fcoe_shost_template,
sizeof(struct fcoe_port));
if (!shost) {
if (!lport) {
FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n");
rc = -ENOMEM;
goto out;
}
lport = shost_priv(shost);
shost = lport->host;
port = lport_priv(lport);
port->lport = lport;
port->fcoe = fcoe;
Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/scsi/fnic/fnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,13 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
* Allocate SCSI Host and set up association between host,
* local port, and fnic
*/
host = scsi_host_alloc(&fnic_host_template,
sizeof(struct fc_lport) + sizeof(struct fnic));
if (!host) {
printk(KERN_ERR PFX "Unable to alloc SCSI host\n");
lp = libfc_host_alloc(&fnic_host_template, sizeof(struct fnic));
if (!lp) {
printk(KERN_ERR PFX "Unable to alloc libfc local port\n");
err = -ENOMEM;
goto err_out;
}
lp = shost_priv(host);
lp->host = host;
host = lp->host;
fnic = lport_priv(lp);
fnic->lport = lp;

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/scsi/libfc/fc_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ int fc_lport_init(struct fc_lport *lport)
if (lport->link_supported_speeds & FC_PORTSPEED_10GBIT)
fc_host_supported_speeds(lport->host) |= FC_PORTSPEED_10GBIT;

INIT_LIST_HEAD(&lport->ema_list);
return 0;
}
EXPORT_SYMBOL(fc_lport_init);
15 changes: 12 additions & 3 deletions trunk/include/scsi/libfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,12 +739,21 @@ static inline void *lport_priv(const struct fc_lport *lp)
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
* Returns: ptr to Scsi_Host
* Returns: libfc lport
*/
static inline struct Scsi_Host *
static inline struct fc_lport *
libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
{
return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
struct fc_lport *lport;
struct Scsi_Host *shost;

shost = scsi_host_alloc(sht, sizeof(*lport) + priv_size);
if (!shost)
return NULL;
lport = shost_priv(shost);
lport->host = shost;
INIT_LIST_HEAD(&lport->ema_list);
return lport;
}

/*
Expand Down

0 comments on commit eb30a17

Please sign in to comment.