[DRBD-user] PATCH: fix for 0.7.24 compile on 2.4 kernel

James R. Leu jleu at inoc.com
Tue May 8 06:51:31 CEST 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


I'm not sure if my ONLY_IN_26 usage is right, but "It compiles for me" ....
<kernel-2.4-bio_put.patch attached>
-- 
James R. Leu
jleu at inoc.com
INOC -> http://inoc.com/
DELIVERING UPTIME
-------------- next part --------------
diff -uNr drbd-0.7.24/drbd/drbd_compat_wrappers.h drbd-0.7.24-jleu/drbd/drbd_compat_wrappers.h
--- drbd-0.7.24/drbd/drbd_compat_wrappers.h	2006-10-19 06:46:05.000000000 -0500
+++ drbd-0.7.24-jleu/drbd/drbd_compat_wrappers.h	2007-05-07 23:17:16.000000000 -0500
@@ -5,6 +5,7 @@
 
 #define __module_get  __MOD_INC_USE_COUNT
 #define   module_put  __MOD_DEC_USE_COUNT
+#define bio_put(foo) put_bh((struct buffer_head*)(foo))
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
 /*
diff -uNr drbd-0.7.24/drbd/drbd_req.c drbd-0.7.24-jleu/drbd/drbd_req.c
--- drbd-0.7.24/drbd/drbd_req.c	2007-05-04 09:01:16.000000000 -0500
+++ drbd-0.7.24-jleu/drbd/drbd_req.c	2007-05-07 23:45:42.000000000 -0500
@@ -270,8 +270,10 @@
 
 	local = inc_local(mdev);
 	if (!local) {
-		bio_put(req->private_bio); /* or we get a bio leak */
-		req->private_bio = NULL;
+		ONLY_IN_26(
+			bio_put(req->private_bio); /* or we get a bio leak */
+			req->private_bio = NULL;
+		);
 	}
 	NOT_IN_26( if (rw == READA) rw=READ );
 	if (rw == READ || rw == READA) {
@@ -298,8 +300,10 @@
 				 * local io stack.
 				 */
 				local = 0;
-				bio_put(req->private_bio);
-				req->private_bio = NULL;
+				ONLY_IN_26(
+					bio_put(req->private_bio);
+					req->private_bio = NULL;
+				);
 				dec_local(mdev);
 			}
 		}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20070507/d79156ca/attachment.pgp>


More information about the drbd-user mailing list