summaryrefslogtreecommitdiff
blob: 90a6d8c1aa173053955014aa0d49ffa10bfc26bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
diff -Naru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
--- a/drivers/scsi/qla2xxx/qla_os.c	2005-11-03 03:16:01 -08:00
+++ b/drivers/scsi/qla2xxx/qla_os.c	2005-11-03 03:16:01 -08:00
@@ -235,67 +235,6 @@
 static __inline__ void
 qla2x00_delete_from_done_queue(scsi_qla_host_t *, srb_t *); 
 
-/**************************************************************************
-* sp_put
-*
-* Description:
-*   Decrement reference count and call the callback if we're the last
-*   owner of the specified sp. Will get the host_lock before calling
-*   the callback.
-*
-* Input:
-*   ha - pointer to the scsi_qla_host_t where the callback is to occur.
-*   sp - pointer to srb_t structure to use.
-*
-* Returns:
-*
-**************************************************************************/
-static inline void
-sp_put(struct scsi_qla_host * ha, srb_t *sp)
-{
-        if (atomic_read(&sp->ref_count) == 0) {
-		qla_printk(KERN_INFO, ha,
-			"%s(): **** SP->ref_count not zero\n",
-			__func__);
-                DEBUG2(BUG();)
-
-                return;
-	}
-
-        if (!atomic_dec_and_test(&sp->ref_count)) {
-                return;
-        }
-
-        qla2x00_callback(ha, sp->cmd);
-}
-
-/**************************************************************************
-* sp_get
-*
-* Description:
-*   Increment reference count of the specified sp.
-*
-* Input:
-*   sp - pointer to srb_t structure to use.
-*
-* Returns:
-*
-**************************************************************************/
-static inline void
-sp_get(struct scsi_qla_host * ha, srb_t *sp)
-{
-        atomic_inc(&sp->ref_count);
-
-        if (atomic_read(&sp->ref_count) > 2) {
-		qla_printk(KERN_INFO, ha,
-			"%s(): **** SP->ref_count greater than two\n",
-			__func__);
-                DEBUG2(BUG();)
-
-		return;
-	}
-}
-
 /*
 * qla2x00_callback
 *      Returns the completed SCSI command to LINUX.
@@ -364,6 +303,67 @@
 
 	/* Call the mid-level driver interrupt handler */
 	(*(cmd)->scsi_done)(cmd);
+}
+
+/**************************************************************************
+* sp_put
+*
+* Description:
+*   Decrement reference count and call the callback if we're the last
+*   owner of the specified sp. Will get the host_lock before calling
+*   the callback.
+*
+* Input:
+*   ha - pointer to the scsi_qla_host_t where the callback is to occur.
+*   sp - pointer to srb_t structure to use.
+*
+* Returns:
+*
+**************************************************************************/
+static inline void
+sp_put(struct scsi_qla_host * ha, srb_t *sp)
+{
+        if (atomic_read(&sp->ref_count) == 0) {
+		qla_printk(KERN_INFO, ha,
+			"%s(): **** SP->ref_count not zero\n",
+			__func__);
+                DEBUG2(BUG();)
+
+                return;
+	}
+
+        if (!atomic_dec_and_test(&sp->ref_count)) {
+                return;
+        }
+
+        qla2x00_callback(ha, sp->cmd);
+}
+
+/**************************************************************************
+* sp_get
+*
+* Description:
+*   Increment reference count of the specified sp.
+*
+* Input:
+*   sp - pointer to srb_t structure to use.
+*
+* Returns:
+*
+**************************************************************************/
+static inline void
+sp_get(struct scsi_qla_host * ha, srb_t *sp)
+{
+        atomic_inc(&sp->ref_count);
+
+        if (atomic_read(&sp->ref_count) > 2) {
+		qla_printk(KERN_INFO, ha,
+			"%s(): **** SP->ref_count greater than two\n",
+			__func__);
+                DEBUG2(BUG();)
+
+		return;
+	}
 }
 
 static inline void 
diff -Naru a/drivers/scsi/qla2xxx/qla_rscn.c b/drivers/scsi/qla2xxx/qla_rscn.c
--- a/drivers/scsi/qla2xxx/qla_rscn.c	2005-11-03 03:16:01 -08:00
+++ b/drivers/scsi/qla2xxx/qla_rscn.c	2005-11-03 03:16:01 -08:00
@@ -242,6 +242,20 @@
 }
 
 /**
+ * qla2x00_remove_iodesc_timer() - Remove an active timer from an IO descriptor.
+ * @iodesc: io descriptor
+ */
+static inline void
+qla2x00_remove_iodesc_timer(struct io_descriptor *iodesc)
+{
+	if (iodesc->timer.function != NULL) {
+		del_timer_sync(&iodesc->timer);
+		iodesc->timer.data = (unsigned long) NULL;
+		iodesc->timer.function = NULL;
+	}
+}
+
+/**
  * qla2x00_init_io_descriptors() - Initialize the pool of IO descriptors.
  * @ha: HA context
  */
@@ -309,20 +323,6 @@
 	iodesc->timer.function =
 	    (void (*) (unsigned long)) qla2x00_iodesc_timeout;
 	add_timer(&iodesc->timer);
-}
-
-/**
- * qla2x00_remove_iodesc_timer() - Remove an active timer from an IO descriptor.
- * @iodesc: io descriptor
- */
-static inline void
-qla2x00_remove_iodesc_timer(struct io_descriptor *iodesc)
-{
-	if (iodesc->timer.function != NULL) {
-		del_timer_sync(&iodesc->timer);
-		iodesc->timer.data = (unsigned long) NULL;
-		iodesc->timer.function = NULL;
-	}
 }
 
 /** 
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/09/10 13:19:39-04:00 akpm@osdl.org 
#   [PATCH] qla2xxx gcc-3.5 fixes
#   
#   From: Adrian Bunk <bunk@fs.tum.de>
#   
#     CC      drivers/scsi/qla2xxx/qla_os.o
#   drivers/scsi/qla2xxx/qla_os.c: In function `qla2x00_queuecommand':
#   drivers/scsi/qla2xxx/qla_os.c:315: sorry, unimplemented: inlining failed
#   in call to 'qla2x00_callback': function not considered for inlining
#   drivers/scsi/qla2xxx/qla_os.c:269: sorry, unimplemented: called from here
#   drivers/scsi/qla2xxx/qla_os.c:315: sorry, unimplemented: inlining failed
#   in call to 'qla2x00_callback': function not considered for inlining
#   drivers/scsi/qla2xxx/qla_os.c:269: sorry, unimplemented: called from here
#   make[3]: *** [drivers/scsi/qla2xxx/qla_os.o] Error 1
#   ...
#     CC      drivers/scsi/qla2xxx/qla_rscn.o
#   drivers/scsi/qla2xxx/qla_rscn.c: In function `qla2x00_cancel_io_descriptors':
#   drivers/scsi/qla2xxx/qla_rscn.c:320: sorry, unimplemented: inlining
#   failed in call to 'qla2x00_remove_iodesc_timer': function not considered for inlining
#   drivers/scsi/qla2xxx/qla_rscn.c:257: sorry, unimplemented: called from here
#   make[3]: *** [drivers/scsi/qla2xxx/qla_rscn.o] Error 1
#   
#   Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
#   Signed-off-by: Andrew Morton <akpm@osdl.org>
#   Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
# 
# drivers/scsi/qla2xxx/qla_os.c
#   2004/07/29 10:58:59-04:00 akpm@osdl.org +61 -61
#   qla2xxx gcc-3.5 fixes
# 
# drivers/scsi/qla2xxx/qla_rscn.c
#   2004/07/29 10:58:59-04:00 akpm@osdl.org +14 -14
#   qla2xxx gcc-3.5 fixes
#