aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-12-21 14:20:10 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 17:37:46 -0500
commit6e315a066d7d1917f762d2f2a14e9a71a8656fea (patch)
treecfc7f4f79f68a26356fea3f0307104dbefbbd450 /drivers
parent3d26fea01d5f80e3e585d69d8d73a60e1ca563a0 (diff)
target: remove the unused struct iblock_hba
There is no reason to allocate a struct just to store the host number for a debug printk in the detach path. I've simply removed the verbose debugging given that the calling code thinks the number passed in is something different from a host ID anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/target/target_core_iblock.c26
-rw-r--r--drivers/target/target_core_iblock.h5
2 files changed, 0 insertions, 31 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 8572eae62da7..562e787b31d0 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -56,51 +56,25 @@ static void iblock_bio_done(struct bio *, int);
56 */ 56 */
57static int iblock_attach_hba(struct se_hba *hba, u32 host_id) 57static int iblock_attach_hba(struct se_hba *hba, u32 host_id)
58{ 58{
59 struct iblock_hba *ib_host;
60
61 ib_host = kzalloc(sizeof(struct iblock_hba), GFP_KERNEL);
62 if (!ib_host) {
63 pr_err("Unable to allocate memory for"
64 " struct iblock_hba\n");
65 return -ENOMEM;
66 }
67
68 ib_host->iblock_host_id = host_id;
69
70 hba->hba_ptr = ib_host;
71
72 pr_debug("CORE_HBA[%d] - TCM iBlock HBA Driver %s on" 59 pr_debug("CORE_HBA[%d] - TCM iBlock HBA Driver %s on"
73 " Generic Target Core Stack %s\n", hba->hba_id, 60 " Generic Target Core Stack %s\n", hba->hba_id,
74 IBLOCK_VERSION, TARGET_CORE_MOD_VERSION); 61 IBLOCK_VERSION, TARGET_CORE_MOD_VERSION);
75
76 pr_debug("CORE_HBA[%d] - Attached iBlock HBA: %u to Generic\n",
77 hba->hba_id, ib_host->iblock_host_id);
78
79 return 0; 62 return 0;
80} 63}
81 64
82static void iblock_detach_hba(struct se_hba *hba) 65static void iblock_detach_hba(struct se_hba *hba)
83{ 66{
84 struct iblock_hba *ib_host = hba->hba_ptr;
85
86 pr_debug("CORE_HBA[%d] - Detached iBlock HBA: %u from Generic"
87 " Target Core\n", hba->hba_id, ib_host->iblock_host_id);
88
89 kfree(ib_host);
90 hba->hba_ptr = NULL;
91} 67}
92 68
93static void *iblock_allocate_virtdevice(struct se_hba *hba, const char *name) 69static void *iblock_allocate_virtdevice(struct se_hba *hba, const char *name)
94{ 70{
95 struct iblock_dev *ib_dev = NULL; 71 struct iblock_dev *ib_dev = NULL;
96 struct iblock_hba *ib_host = hba->hba_ptr;
97 72
98 ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL); 73 ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL);
99 if (!ib_dev) { 74 if (!ib_dev) {
100 pr_err("Unable to allocate struct iblock_dev\n"); 75 pr_err("Unable to allocate struct iblock_dev\n");
101 return NULL; 76 return NULL;
102 } 77 }
103 ib_dev->ibd_host = ib_host;
104 78
105 pr_debug( "IBLOCK: Allocated ib_dev for %s\n", name); 79 pr_debug( "IBLOCK: Allocated ib_dev for %s\n", name);
106 80
diff --git a/drivers/target/target_core_iblock.h b/drivers/target/target_core_iblock.h
index 5cf1860c10d0..300610417447 100644
--- a/drivers/target/target_core_iblock.h
+++ b/drivers/target/target_core_iblock.h
@@ -19,11 +19,6 @@ struct iblock_dev {
19 u32 ibd_flags; 19 u32 ibd_flags;
20 struct bio_set *ibd_bio_set; 20 struct bio_set *ibd_bio_set;
21 struct block_device *ibd_bd; 21 struct block_device *ibd_bd;
22 struct iblock_hba *ibd_host;
23} ____cacheline_aligned;
24
25struct iblock_hba {
26 int iblock_host_id;
27} ____cacheline_aligned; 22} ____cacheline_aligned;
28 23
29#endif /* TARGET_CORE_IBLOCK_H */ 24#endif /* TARGET_CORE_IBLOCK_H */