[DRBD-cvs] drbd by lars; use q->unplug_fn(q) instead of blk_run_q...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Sun, 18 Apr 2004 12:34:01 +0200 (CEST)


DRBD CVS committal

Author  : lars
Module  : drbd

Dir     : drbd/drbd


Modified Files:
      Tag: rel-0_7-branch
	drbd_actlog.c drbd_compat_wrappers.h drbd_main.c 


Log Message:
use q->unplug_fn(q) instead of blk_run_queue(q).
Now it works on top of DM and others without the need
for fallback to the meanwhile removed blk_run_queues().
This seems the right thing to do, it is the same thing
blk_run_queues() had done for all queues.
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_actlog.c,v
retrieving revision 1.1.2.84
retrieving revision 1.1.2.85
diff -u -3 -r1.1.2.84 -r1.1.2.85
--- drbd_actlog.c	16 Apr 2004 12:18:55 -0000	1.1.2.84
+++ drbd_actlog.c	18 Apr 2004 10:33:56 -0000	1.1.2.85
@@ -77,8 +77,12 @@
 	init_completion(&event);
 	bio.bi_private = &event;
 	bio.bi_end_io = drbd_md_io_complete;
+#ifdef BIO_RW_SYNC
+	submit_bio(rw | (1 << BIO_RW_SYNC), &bio);
+#else
 	submit_bio(rw, &bio);
 	drbd_blk_run_queue(bdev_get_queue(mdev->md_bdev));
+#endif
 	wait_for_completion(&event);
 
 	return test_bit(BIO_UPTODATE, &bio.bi_flags);
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_compat_wrappers.h,v
retrieving revision 1.1.2.37
retrieving revision 1.1.2.38
diff -u -3 -r1.1.2.37 -r1.1.2.38
--- drbd_compat_wrappers.h	9 Apr 2004 06:53:43 -0000	1.1.2.37
+++ drbd_compat_wrappers.h	18 Apr 2004 10:33:56 -0000	1.1.2.38
@@ -511,10 +511,8 @@
 
 static inline void drbd_blk_run_queue(request_queue_t *q)
 {
-	if (q && q->queue_lock && q->request_fn)
-		blk_run_queue(q);
-	else
-		blk_run_queues();
+	if (q && q->unplug_fn)
+		q->unplug_fn(q);
 }
 
 static inline void drbd_kick_lo(drbd_dev *mdev)
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.150
retrieving revision 1.73.2.151
diff -u -3 -r1.73.2.150 -r1.73.2.151
--- drbd_main.c	16 Apr 2004 12:18:55 -0000	1.73.2.150
+++ drbd_main.c	18 Apr 2004 10:33:56 -0000	1.73.2.151
@@ -1046,9 +1046,17 @@
 }
 #else
 
+/* ugly ifdef, and only to quieten one compiler warning for now.
+ * as 2.6.X moves on, we can probably drop it again.
+ */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,5)
+STATIC void drbd_send_write_hint(request_queue_t *q)
+{
+#else
 STATIC void drbd_send_write_hint(void *data)
 {
-	request_queue_t *q = data;
+	request_queue_t *q = (request_queue_t*)data;
+#endif
 	drbd_dev *mdev = q->queuedata;
 	Drbd_Header h;