diff options
author | Vasu Dev <vasu.dev@intel.com> | 2009-03-17 19:42:29 +0100 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 16:23:07 +0200 |
commit | a0a25da2a495a889664dc946942b8666665cd1e1 (patch) | |
tree | f3ac1dd6adb76490afa828298e71992ba5045d8f /include/scsi | |
parent | [SCSI] fcoe: cleans up libfcoe.h and adds fcoe.h for fcoe module (diff) | |
download | linux-a0a25da2a495a889664dc946942b8666665cd1e1.tar.xz linux-a0a25da2a495a889664dc946942b8666665cd1e1.zip |
[SCSI] fcoe, libfc: fix double fcoe_softc memory alloc
The foce_softc mem was reserved by libfc_host_alloc as well as
by fcoe_host_alloc.
Removes one liner fcoe_host_alloc completely, instead directly calls
libfc_host_alloc to alloc scsi_host with libfc for just one fcoe_softc
as fcoe private data.
Moves libfc_host_alloc to libfc.h since it is a libfc API, placed
lport_priv API adjacent to libfc_host_alloc since this is related
to scsi_host priv data.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/libfc.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 4e1d394348cf..0303a6a098cc 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -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; @@ -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 |