Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142104
b: refs/heads/master
c: a0a25da
h: refs/heads/master
v: v3
  • Loading branch information
Vasu Dev authored and James Bottomley committed Apr 3, 2009
1 parent 99445de commit 67f2fef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 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: fdd78027fd472351783fb6110a72d991c1a07402
refs/heads/master: a0a25da2a495a889664dc946942b8666665cd1e1
33 changes: 2 additions & 31 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *);
static int fcoe_hostlist_add(const struct fc_lport *);
static int fcoe_hostlist_remove(const struct fc_lport *);

static struct Scsi_Host *fcoe_host_alloc(struct scsi_host_template *, int);

static int fcoe_check_wait_queue(struct fc_lport *);
static void fcoe_recv_flogi(struct fcoe_softc *, struct fc_frame *, u8 *);
static int fcoe_device_notification(struct notifier_block *, ulong, void *);
Expand Down Expand Up @@ -464,8 +462,8 @@ static int fcoe_if_create(struct net_device *netdev)
if (lp)
return -EEXIST;

shost = fcoe_host_alloc(&fcoe_shost_template,
sizeof(struct fcoe_softc));
shost = libfc_host_alloc(&fcoe_shost_template,
sizeof(struct fcoe_softc));
if (!shost) {
FC_DBG("Could not allocate host structure\n");
return -ENOMEM;
Expand Down Expand Up @@ -1715,33 +1713,6 @@ void fcoe_clean_pending_queue(struct fc_lport *lp)
}
EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);

/**
* libfc_host_alloc() - Allocate a Scsi_Host with room for the fc_lport
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
* Returns: ptr to Scsi_Host
* TODO: to libfc?
*/
static inline struct Scsi_Host *
libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
{
return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
}

/**
* fcoe_host_alloc() - Allocate a Scsi_Host with room for the fcoe_softc
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
* Returns: ptr to Scsi_Host
*/
struct Scsi_Host *fcoe_host_alloc(struct scsi_host_template *sht, int priv_size)
{
return libfc_host_alloc(sht, sizeof(struct fcoe_softc) + priv_size);
}
EXPORT_SYMBOL_GPL(fcoe_host_alloc);

/**
* fcoe_reset() - Resets the fcoe
* @shost: shost the reset is from
Expand Down
22 changes: 17 additions & 5 deletions trunk/include/scsi/libfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,6 @@ struct fc_lport {
/*
* FC_LPORT HELPER FUNCTIONS
*****************************/
static inline void *lport_priv(const struct fc_lport *lp)
{
return (void *)(lp + 1);
}

static inline int fc_lport_test_ready(struct fc_lport *lp)
{
return lp->state == LPORT_ST_READY;
Expand Down Expand Up @@ -743,6 +738,23 @@ static inline struct fcoe_dev_stats *fc_lport_get_stats(struct fc_lport *lp)
return per_cpu_ptr(lp->dev_stats, smp_processor_id());
}

static inline void *lport_priv(const struct fc_lport *lp)
{
return (void *)(lp + 1);
}

/**
* libfc_host_alloc() - Allocate a Scsi_Host with room for the fc_lport
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
* Returns: ptr to Scsi_Host
*/
static inline struct Scsi_Host *
libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
{
return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
}

/*
* LOCAL PORT LAYER
Expand Down

0 comments on commit 67f2fef

Please sign in to comment.