aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-11-27 23:32:05 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-12-29 02:28:45 -0500
commit8f11b3e99a1136fcbb67316c3260f085299c0bff (patch)
treebb9b12fe23aceac19e24f674786612d0fcad2142 /include
parentf671620e7d895af221bdfeda751d54fa55ed9546 (diff)
block: make barrier completion more robust
Barrier completion had the following assumptions. * start_ordered() couldn't finish the whole sequence properly. If all actions are to be skipped, q->ordseq is set correctly but the actual completion was never triggered thus hanging the barrier request. * Drain completion in elv_complete_request() assumed that there's always at least one request in the queue when drain completes. Both assumptions are true but these assumptions need to be removed to improve empty barrier implementation. This patch makes the following changes. * Make start_ordered() use blk_ordered_complete_seq() to mark skipped steps complete and notify __elv_next_request() that it should fetch the next request if the whole barrier has completed inside start_ordered(). * Make drain completion path in elv_complete_request() check whether the queue is empty. Empty queue also indicates drain completion. * While at it, convert 0/1 return from blk_do_ordered() to false/true. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b044267009ed..3c7078e0129d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -866,10 +866,10 @@ extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
866extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); 866extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
867extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 867extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
868extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); 868extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
869extern int blk_do_ordered(struct request_queue *, struct request **); 869extern bool blk_do_ordered(struct request_queue *, struct request **);
870extern unsigned blk_ordered_cur_seq(struct request_queue *); 870extern unsigned blk_ordered_cur_seq(struct request_queue *);
871extern unsigned blk_ordered_req_seq(struct request *); 871extern unsigned blk_ordered_req_seq(struct request *);
872extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); 872extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int);
873 873
874extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); 874extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
875extern void blk_dump_rq_flags(struct request *, char *); 875extern void blk_dump_rq_flags(struct request *, char *);