1 |
vapier 08/02/22 03:38:51 |
2 |
|
3 |
Modified: ietd-init.d |
4 |
Added: iscsitarget-0.4.15-isns-set-scn-flag.patch |
5 |
iscsitarget-0.4.15-kmem.patch |
6 |
iscsitarget-0.4.15-scatter.patch |
7 |
iscsitarget-0.4.15-build.patch |
8 |
Log: |
9 |
Respect user LDFLAGS. Fix building with gcc-3.4/-O0 #180619 by Natanael Copa. Add some kernel updates from upstream #191313. |
10 |
(Portage version: 2.2_pre2) |
11 |
|
12 |
Revision Changes Path |
13 |
1.2 sys-block/iscsitarget/files/ietd-init.d |
14 |
|
15 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d?rev=1.2&view=markup |
16 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d?rev=1.2&content-type=text/plain |
17 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d?r1=1.1&r2=1.2 |
18 |
|
19 |
Index: ietd-init.d |
20 |
=================================================================== |
21 |
RCS file: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d,v |
22 |
retrieving revision 1.1 |
23 |
retrieving revision 1.2 |
24 |
diff -u -r1.1 -r1.2 |
25 |
--- ietd-init.d 20 Feb 2006 08:33:40 -0000 1.1 |
26 |
+++ ietd-init.d 22 Feb 2008 03:38:51 -0000 1.2 |
27 |
@@ -1,7 +1,7 @@ |
28 |
#!/sbin/runscript |
29 |
-# Copyright 1999-2005 Gentoo Technologies, Inc. |
30 |
+# Copyright 1999-2008 Gentoo Technologies, Inc. |
31 |
# Distributed under the terms of the GNU General Public License, v2 or later |
32 |
-# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d,v 1.1 2006/02/20 08:33:40 robbat2 Exp $ |
33 |
+# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/ietd-init.d,v 1.2 2008/02/22 03:38:51 vapier Exp $ |
34 |
|
35 |
MEM_SIZE=1048576 |
36 |
DAEMON=/usr/sbin/ietd |
37 |
@@ -79,7 +79,7 @@ |
38 |
# ugly, but ietadm does not allways provides correct exit values |
39 |
RETURN="$(ietadm --op delete 2>&1)" |
40 |
RETVAL=$? |
41 |
- if [ $RETVAL == "0" ] && [[ $RETURN != "something wrong" ]]; then |
42 |
+ if [ $RETVAL -eq 0 ] && [ "$RETURN" != "something wrong" ] ; then |
43 |
eend 0 |
44 |
else |
45 |
eend 1 |
46 |
|
47 |
|
48 |
|
49 |
1.1 sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch |
50 |
|
51 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch?rev=1.1&view=markup |
52 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch?rev=1.1&content-type=text/plain |
53 |
|
54 |
Index: iscsitarget-0.4.15-isns-set-scn-flag.patch |
55 |
=================================================================== |
56 |
http://bugs.gentoo.org/180619 |
57 |
|
58 |
--- usr/isns.c |
59 |
+++ usr/isns.c |
60 |
@@ -215,13 +215,13 @@ |
61 |
|
62 |
#if __BYTE_ORDER == __LITTLE_ENDIAN |
63 |
#define set_scn_flag(x) \ |
64 |
-{ \ |
65 |
+({ \ |
66 |
x = (x & 0x55555555) << 1 | (x & 0xaaaaaaaa) >> 1; \ |
67 |
x = (x & 0x33333333) << 2 | (x & 0xcccccccc) >> 2; \ |
68 |
x = (x & 0x0f0f0f0f) << 4 | (x & 0xf0f0f0f0) >> 4; \ |
69 |
x = (x & 0x00ff00ff) << 8 | (x & 0xff00ff00) >> 8; \ |
70 |
x = (x & 0x0000ffff) << 16 | (x & 0xffff0000) >> 16; \ |
71 |
-} |
72 |
+}) |
73 |
#else |
74 |
#define set_scn_flag(x) (x) |
75 |
#endif |
76 |
|
77 |
|
78 |
|
79 |
1.1 sys-block/iscsitarget/files/iscsitarget-0.4.15-kmem.patch |
80 |
|
81 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-kmem.patch?rev=1.1&view=markup |
82 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-kmem.patch?rev=1.1&content-type=text/plain |
83 |
|
84 |
Index: iscsitarget-0.4.15-kmem.patch |
85 |
=================================================================== |
86 |
------------------------------------------------------------------------ |
87 |
r138 | tomo | 2007-09-20 19:26:20 -0400 (Thu, 20 Sep 2007) | 12 lines |
88 |
|
89 |
From: Arne Redlich <agr@×××××××××××.de> |
90 |
Subject: 2.6.23 compile fix |
91 |
Date: Thu, 20 Sep 2007 23:30:19 +0200 |
92 |
|
93 |
kmem_cache_create()'s arguments will change with 2.6.23. |
94 |
|
95 |
Note that instead of simply modifying the kmem_cache_create() calls to |
96 |
match the new interface, they're replaced with KMEM_CACHE(), which was |
97 |
introduced with 2.6.22 to simplify slab cache creation. |
98 |
|
99 |
Merely compile tested. |
100 |
|
101 |
------------------------------------------------------------------------ |
102 |
Index: kernel/iscsi.c |
103 |
=================================================================== |
104 |
--- kernel/iscsi.c (revision 137) |
105 |
+++ kernel/iscsi.c (revision 138) |
106 |
@@ -1757,8 +1757,7 @@ static int iscsi_init(void) |
107 |
if ((err = event_init()) < 0) |
108 |
goto err; |
109 |
|
110 |
- iscsi_cmnd_cache = kmem_cache_create("iscsi_cmnd", sizeof(struct iscsi_cmnd), |
111 |
- 0, 0, NULL, NULL); |
112 |
+ iscsi_cmnd_cache = KMEM_CACHE(iscsi_cmnd, 0); |
113 |
if (!iscsi_cmnd_cache) |
114 |
goto err; |
115 |
|
116 |
Index: kernel/tio.c |
117 |
=================================================================== |
118 |
--- kernel/tio.c (revision 137) |
119 |
+++ kernel/tio.c (revision 138) |
120 |
@@ -110,8 +110,7 @@ int tio_sync(struct iet_volume *lu, stru |
121 |
|
122 |
int tio_init(void) |
123 |
{ |
124 |
- tio_cache = kmem_cache_create("tio", sizeof(struct tio), |
125 |
- 0, 0, NULL, NULL); |
126 |
+ tio_cache = KMEM_CACHE(tio, 0); |
127 |
return tio_cache ? 0 : -ENOMEM; |
128 |
} |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
1.1 sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch |
134 |
|
135 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch?rev=1.1&view=markup |
136 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-scatter.patch?rev=1.1&content-type=text/plain |
137 |
|
138 |
Index: iscsitarget-0.4.15-scatter.patch |
139 |
=================================================================== |
140 |
------------------------------------------------------------------------ |
141 |
r146 | tomo | 2008-02-11 07:26:38 -0500 (Mon, 11 Feb 2008) | 5 lines |
142 |
|
143 |
From: Arne Redlich <agr@×××××××××××.de> |
144 |
Subject: fix compilation on 2.6.24 |
145 |
Date: Sun, 10 Feb 2008 22:26:28 +0100 |
146 |
|
147 |
|
148 |
------------------------------------------------------------------------ |
149 |
Index: kernel/block-io.c |
150 |
=================================================================== |
151 |
--- kernel/block-io.c (revision 145) |
152 |
+++ kernel/block-io.c (revision 146) |
153 |
@@ -28,15 +28,10 @@ struct tio_work { |
154 |
struct completion tio_complete; |
155 |
}; |
156 |
|
157 |
-static int |
158 |
-blockio_bio_endio(struct bio *bio, unsigned int bytes_done, int error) |
159 |
+static void blockio_bio_endio(struct bio *bio, int error) |
160 |
{ |
161 |
struct tio_work *tio_work = bio->bi_private; |
162 |
|
163 |
- /* Ignore partials */ |
164 |
- if (bio->bi_size) |
165 |
- return 1; |
166 |
- |
167 |
error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO; |
168 |
|
169 |
if (error) |
170 |
@@ -47,8 +42,6 @@ blockio_bio_endio(struct bio *bio, unsig |
171 |
complete(&tio_work->tio_complete); |
172 |
|
173 |
bio_put(bio); |
174 |
- |
175 |
- return 0; |
176 |
} |
177 |
|
178 |
/* |
179 |
Index: kernel/config.c |
180 |
=================================================================== |
181 |
--- kernel/config.c (revision 145) |
182 |
+++ kernel/config.c (revision 146) |
183 |
@@ -40,7 +40,7 @@ int iet_procfs_init(void) |
184 |
int i; |
185 |
struct proc_dir_entry *ent; |
186 |
|
187 |
- if (!(proc_iet_dir = proc_mkdir("net/iet", 0))) |
188 |
+ if (!(proc_iet_dir = proc_mkdir("iet", init_net.proc_net))) |
189 |
goto err; |
190 |
|
191 |
proc_iet_dir->owner = THIS_MODULE; |
192 |
Index: kernel/digest.c |
193 |
=================================================================== |
194 |
--- kernel/digest.c (revision 145) |
195 |
+++ kernel/digest.c (revision 146) |
196 |
@@ -161,22 +161,17 @@ static inline void __dbg_simulate_data_d |
197 |
} |
198 |
} |
199 |
|
200 |
-/* Copied from linux-iscsi initiator and slightly adjusted */ |
201 |
-#define SETSG(sg, p, l) do { \ |
202 |
- (sg).page = virt_to_page((p)); \ |
203 |
- (sg).offset = ((unsigned long)(p) & ~PAGE_CACHE_MASK); \ |
204 |
- (sg).length = (l); \ |
205 |
-} while (0) |
206 |
- |
207 |
static void digest_header(struct hash_desc *hash, struct iscsi_pdu *pdu, |
208 |
u8 *crc) |
209 |
{ |
210 |
struct scatterlist sg[2]; |
211 |
unsigned int nbytes = sizeof(struct iscsi_hdr); |
212 |
|
213 |
- SETSG(sg[0], &pdu->bhs, nbytes); |
214 |
+ sg_init_table(sg, pdu->ahssize ? 2 : 1); |
215 |
+ |
216 |
+ sg_set_buf(&sg[0], &pdu->bhs, nbytes); |
217 |
if (pdu->ahssize) { |
218 |
- SETSG(sg[1], pdu->ahs, pdu->ahssize); |
219 |
+ sg_set_buf(&sg[1], pdu->ahs, pdu->ahssize); |
220 |
nbytes += pdu->ahssize; |
221 |
} |
222 |
|
223 |
@@ -220,6 +215,7 @@ static void digest_data(struct hash_desc |
224 |
|
225 |
assert(count <= ISCSI_CONN_IOV_MAX); |
226 |
|
227 |
+ sg_init_table(sg, ARRAY_SIZE(cmnd->conn->hash_sg)); |
228 |
crypto_hash_init(hash); |
229 |
|
230 |
for (i = 0; size; i++) { |
231 |
@@ -228,13 +224,13 @@ static void digest_data(struct hash_desc |
232 |
else |
233 |
length = size; |
234 |
|
235 |
- sg[i].page = tio->pvec[idx + i]; |
236 |
- sg[i].offset = offset; |
237 |
- sg[i].length = length; |
238 |
+ sg_set_page(&sg[i], tio->pvec[idx + i], length, offset); |
239 |
size -= length; |
240 |
offset = 0; |
241 |
} |
242 |
|
243 |
+ sg_mark_end(&sg[i - 1]); |
244 |
+ |
245 |
crypto_hash_update(hash, sg, nbytes); |
246 |
crypto_hash_final(hash, crc); |
247 |
} |
248 |
Index: kernel/event.c |
249 |
=================================================================== |
250 |
--- kernel/event.c (revision 145) |
251 |
+++ kernel/event.c (revision 146) |
252 |
@@ -28,7 +28,7 @@ static int event_recv_msg(struct sk_buff |
253 |
return 0; |
254 |
} |
255 |
|
256 |
-static int event_recv_skb(struct sk_buff *skb) |
257 |
+static void event_recv_skb(struct sk_buff *skb) |
258 |
{ |
259 |
int err; |
260 |
struct nlmsghdr *nlh; |
261 |
@@ -37,7 +37,7 @@ static int event_recv_skb(struct sk_buff |
262 |
while (skb->len >= NLMSG_SPACE(0)) { |
263 |
nlh = (struct nlmsghdr *)skb->data; |
264 |
if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) |
265 |
- return 0; |
266 |
+ break; |
267 |
rlen = NLMSG_ALIGN(nlh->nlmsg_len); |
268 |
if (rlen > skb->len) |
269 |
rlen = skb->len; |
270 |
@@ -47,19 +47,6 @@ static int event_recv_skb(struct sk_buff |
271 |
netlink_ack(skb, nlh, 0); |
272 |
skb_pull(skb, rlen); |
273 |
} |
274 |
- return 0; |
275 |
-} |
276 |
- |
277 |
-static void event_recv(struct sock *sk, int length) |
278 |
-{ |
279 |
- struct sk_buff *skb; |
280 |
- |
281 |
- while ((skb = skb_dequeue(&sk->sk_receive_queue))) { |
282 |
- if (event_recv_skb(skb) && skb->len) |
283 |
- skb_queue_head(&sk->sk_receive_queue, skb); |
284 |
- else |
285 |
- kfree_skb(skb); |
286 |
- } |
287 |
} |
288 |
|
289 |
static int notify(void *data, int len, int gfp_mask) |
290 |
@@ -95,7 +82,8 @@ int event_send(u32 tid, u64 sid, u32 cid |
291 |
|
292 |
int event_init(void) |
293 |
{ |
294 |
- nl = netlink_kernel_create(NETLINK_IET, 1, event_recv, THIS_MODULE); |
295 |
+ nl = netlink_kernel_create(&init_net, NETLINK_IET, 1, event_recv_skb, |
296 |
+ NULL, THIS_MODULE); |
297 |
if (!nl) |
298 |
return -ENOMEM; |
299 |
else |
300 |
|
301 |
|
302 |
|
303 |
1.1 sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch |
304 |
|
305 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch?rev=1.1&view=markup |
306 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.15-build.patch?rev=1.1&content-type=text/plain |
307 |
|
308 |
Index: iscsitarget-0.4.15-build.patch |
309 |
=================================================================== |
310 |
--- usr/Makefile |
311 |
+++ usr/Makefile |
312 |
@@ -1,15 +1,14 @@ |
313 |
-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include |
314 |
+CFLAGS ?= -O2 -fno-inline -g |
315 |
+WARNFLAGS = -Wall -Wstrict-prototypes |
316 |
+CFLAGS += $(WARNFLAGS) -I../include |
317 |
PROGRAMS = ietd ietadm |
318 |
-LIBS = -lcrypto |
319 |
+LDLIBS = -lcrypto |
320 |
|
321 |
all: $(PROGRAMS) |
322 |
|
323 |
ietd: ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o |
324 |
|
325 |
- $(CC) $^ -o $@ $(LIBS) |
326 |
- |
327 |
ietadm: ietadm.o param.o |
328 |
- $(CC) $^ -o $@ |
329 |
|
330 |
clean: |
331 |
rm -f *.o $(PROGRAMS) |
332 |
|
333 |
|
334 |
|
335 |
-- |
336 |
gentoo-commits@l.g.o mailing list |