(My apologies if this is a duplicate)
Has anyone had any luck building pre5 for a 2.2 kernel?
For pre3 I had to hack it a bit to get it to compile, but I'm not sure
I can for pre5.
Specifically: pre5 now uses wait_queue_t, that was not the case in
pre3. This makes drbd_double_sleep_on() impossible to compile. I
looked on a 2.4.2 (Red Hat 7.1) system and wait_queue_t is defined in
/usr/include/linux/wait.h, this is not the case in 2.2 (Red Hat 6.1).
Are there plans to support 2.2 with DRBD 1.6?
The other changes that I had to do included (the diff file is below):
drbd/Makefile.vars: My gcc didn't like
"-mpreferred-stack-boundary=2", I removed it from
KAF_i386.
drbd/Makefile: The definition of REQ_O wasn't working, I just hard
coded it to drbd_req-2.2.o.
drbd/drbd_int.h and drbd_main.c : Moved the definitions for
init_MUTEX_LOCKED, init_MUTEX,
init_waitqueue_head and
wait_queue_head_t from drbd_main.c
to drbd_int.h.
drbd/drbd_receiver.c: Compilation errors, substituted
unacked_cnt.counter for unacked_cnt.
if (drbd_conf[minor].unacked_cnt >= (NR_REQUEST / 4)) {
if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
Thanks.
(diffs...)
diff -r drbd/Makefile.vars drbd.localchanges/Makefile.vars
40c40
< KAF_i386 := -fno-strict-aliasing -mpreferred-stack-boundary=2
---
> KAF_i386 := -fno-strict-aliasing # -mpreferred-stack-boundary=2
diff -r drbd/drbd/Makefile drbd.localchanges/drbd/Makefile
24c24,25
< REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
---
> #REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> REQ_O = drbd_req-2.2.o
diff -r drbd/drbd/drbd_int.h drbd.localchanges/drbd/drbd_int.h
56a57,73
> #if 1
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
> #define init_MUTEX_LOCKED( A ) (*(A)=MUTEX_LOCKED)
> #define init_MUTEX( A ) (*(A)=MUTEX)
> #define init_waitqueue_head( A ) (*(A)=0)
> typedef struct wait_queue* wait_queue_head_t;
>
> /* I am assuming that 2.2 kernel does not support SMP -tony */
> #define del_timer_sync(t) del_timer(t)
>
>
> #endif
> #endif /* 1 */
>
>
>
>
diff -r drbd/drbd/drbd_main.c drbd.localchanges/drbd/drbd_main.c
72a73
> #if 0
78a80
> #endif
diff -r drbd/drbd/drbd_receiver.c drbd.localchanges/drbd/drbd_receiver.c
638a639
> #if 0
639a641,643
> #else
> if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
> #endif
--
Tony Willoughby tonyw@example.com
"The more it stays the same, the less it changes."
-Spinal Tap
Has anyone had any luck building pre5 for a 2.2 kernel?
For pre3 I had to hack it a bit to get it to compile, but I'm not sure
I can for pre5.
Specifically: pre5 now uses wait_queue_t, that was not the case in
pre3. This makes drbd_double_sleep_on() impossible to compile. I
looked on a 2.4.2 (Red Hat 7.1) system and wait_queue_t is defined in
/usr/include/linux/wait.h, this is not the case in 2.2 (Red Hat 6.1).
Are there plans to support 2.2 with DRBD 1.6?
The other changes that I had to do included (the diff file is below):
drbd/Makefile.vars: My gcc didn't like
"-mpreferred-stack-boundary=2", I removed it from
KAF_i386.
drbd/Makefile: The definition of REQ_O wasn't working, I just hard
coded it to drbd_req-2.2.o.
drbd/drbd_int.h and drbd_main.c : Moved the definitions for
init_MUTEX_LOCKED, init_MUTEX,
init_waitqueue_head and
wait_queue_head_t from drbd_main.c
to drbd_int.h.
drbd/drbd_receiver.c: Compilation errors, substituted
unacked_cnt.counter for unacked_cnt.
if (drbd_conf[minor].unacked_cnt >= (NR_REQUEST / 4)) {
if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
Thanks.
(diffs...)
diff -r drbd/Makefile.vars drbd.localchanges/Makefile.vars
40c40
< KAF_i386 := -fno-strict-aliasing -mpreferred-stack-boundary=2
---
> KAF_i386 := -fno-strict-aliasing # -mpreferred-stack-boundary=2
diff -r drbd/drbd/Makefile drbd.localchanges/drbd/Makefile
24c24,25
< REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
---
> #REQ_O = $(shell if [ "$(KERNVER)" "<" "2.4.0" ]; then echo
"drbd_req-2.2.o"; else echo "drbd_req-2.4.o"; fi )
> REQ_O = drbd_req-2.2.o
diff -r drbd/drbd/drbd_int.h drbd.localchanges/drbd/drbd_int.h
56a57,73
> #if 1
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
> #define init_MUTEX_LOCKED( A ) (*(A)=MUTEX_LOCKED)
> #define init_MUTEX( A ) (*(A)=MUTEX)
> #define init_waitqueue_head( A ) (*(A)=0)
> typedef struct wait_queue* wait_queue_head_t;
>
> /* I am assuming that 2.2 kernel does not support SMP -tony */
> #define del_timer_sync(t) del_timer(t)
>
>
> #endif
> #endif /* 1 */
>
>
>
>
diff -r drbd/drbd/drbd_main.c drbd.localchanges/drbd/drbd_main.c
72a73
> #if 0
78a80
> #endif
diff -r drbd/drbd/drbd_receiver.c drbd.localchanges/drbd/drbd_receiver.c
638a639
> #if 0
639a641,643
> #else
> if (drbd_conf[minor].unacked_cnt.counter >= (NR_REQUEST / 4)) {
> #endif
--
Tony Willoughby tonyw@example.com
"The more it stays the same, the less it changes."
-Spinal Tap