]> git.neil.brown.name Git - history.git/commitdiff
add __blk_stop_queue() as locked variant of blk_stop_queue() and
authorJens Axboe <axboe@burns.home.kernel.dk>
Wed, 24 Jul 2002 18:07:03 +0000 (20:07 +0200)
committerJens Axboe <axboe@burns.home.kernel.dk>
Wed, 24 Jul 2002 18:07:03 +0000 (20:07 +0200)
make cpqarray and cciss use these

drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/ll_rw_blk.c
include/linux/blkdev.h

index 939d7026941586e168af24fe6dbf2db861f3c453..360a1468e5c0988cad92d000ab9e461fe864dff7 100644 (file)
@@ -1863,7 +1863,7 @@ queue:
 
        goto queue;
 startio:
-       blk_stop_queue(q);
+       __blk_stop_queue(q);
        start_io(h);
 }
 
index 31276ef0e87c700150d991d3037fb71834a03587..21139414d6c55c6386ec93a58a596907e0b5a266 100644 (file)
@@ -918,7 +918,7 @@ DBGPX(      printk("Submitting %d sectors in %d segments\n", creq->nr_sectors, seg);
        goto queue_next;
 
 startio:
-       blk_stop_queue(q);
+       __blk_stop_queue(q);
        start_io(h);
 }
 
index c23f57a0ed163443ab51f6bd3561ef5b11ff2da0..e73c1d823428148c6bfe4d1192ca8adef5a5268e 100644 (file)
@@ -900,7 +900,8 @@ void generic_unplug_device(void *data)
  * Description:
  *   blk_start_queue() will clear the stop flag on the queue, and call
  *   the request_fn for the queue if it was in a stopped state when
- *   entered. Also see blk_stop_queue()
+ *   entered. Also see blk_stop_queue(). Must not be called from driver
+ *   request function due to recursion issues.
  **/
 void blk_start_queue(request_queue_t *q)
 {
@@ -914,6 +915,18 @@ void blk_start_queue(request_queue_t *q)
        }
 }
 
+/**
+ * __blk_stop_queue: see blk_stop_queue()
+ *
+ * Description:
+ *  Like blk_stop_queue(), bust queue_lock must be held
+ **/
+void __blk_stop_queue(request_queue_t *q)
+{
+       blk_remove_plug(q);
+       set_bit(QUEUE_FLAG_STOPPED, &q->queue_flags);
+}
+
 /**
  * blk_stop_queue - stop a queue
  * @q:    The &request_queue_t in question
@@ -933,10 +946,8 @@ void blk_stop_queue(request_queue_t *q)
        unsigned long flags;
 
        spin_lock_irqsave(q->queue_lock, flags);
-       blk_remove_plug(q);
+       __blk_stop_queue(q);
        spin_unlock_irqrestore(q->queue_lock, flags);
-
-       set_bit(QUEUE_FLAG_STOPPED, &q->queue_flags);
 }
 
 /**
@@ -2089,4 +2100,5 @@ EXPORT_SYMBOL(blk_queue_invalidate_tags);
 
 EXPORT_SYMBOL(blk_start_queue);
 EXPORT_SYMBOL(blk_stop_queue);
+EXPORT_SYMBOL(__blk_stop_queue);
 EXPORT_SYMBOL(blk_run_queues);
index 7460a98bb0b32f5e179ee3e02940b58d0ee6aea4..726492d4c45ad2c518ddc681c46d72af0215f360 100644 (file)
@@ -295,6 +295,7 @@ extern inline int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct
 extern int block_ioctl(struct block_device *, unsigned int, unsigned long);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
+extern void __blk_stop_queue(request_queue_t *q);
 
 /*
  * get ready for proper ref counting