Commit eeda2160 authored by Jens Axboe's avatar Jens Axboe

add __blk_stop_queue() as locked variant of blk_stop_queue() and

make cpqarray and cciss use these
parent 1da3174f
......@@ -1863,7 +1863,7 @@ static void do_cciss_request(request_queue_t *q)
goto queue;
startio:
blk_stop_queue(q);
__blk_stop_queue(q);
start_io(h);
}
......
......@@ -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);
}
......
......@@ -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);
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment