aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-28 16:51:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-28 16:51:32 -0500
commitf0f0052069989b80d2a3e50c9cd2f2a650bc1aea (patch)
tree40ff39bc341aed8318a54d1bd61a381f41844f71 /include/linux/blkdev.h
parent68fbda7de07e56eb90dd6e58a162527411b388b1 (diff)
parenta65b58663d983e588aed8d1bfc75edaac2527fa7 (diff)
Merge branch 'blk-end-request' of git://git.kernel.dk/linux-2.6-block
* 'blk-end-request' of git://git.kernel.dk/linux-2.6-block: (30 commits) blk_end_request: changing xsysace (take 4) blk_end_request: changing ub (take 4) blk_end_request: cleanup of request completion (take 4) blk_end_request: cleanup 'uptodate' related code (take 4) blk_end_request: remove/unexport end_that_request_* (take 4) blk_end_request: changing scsi (take 4) blk_end_request: add bidi completion interface (take 4) blk_end_request: changing ide-cd (take 4) blk_end_request: add callback feature (take 4) blk_end_request: changing ide normal caller (take 4) blk_end_request: changing cpqarray (take 4) blk_end_request: changing cciss (take 4) blk_end_request: changing ide-scsi (take 4) blk_end_request: changing s390 (take 4) blk_end_request: changing mmc (take 4) blk_end_request: changing i2o_block (take 4) blk_end_request: changing viocd (take 4) blk_end_request: changing xen-blkfront (take 4) blk_end_request: changing viodasd (take 4) blk_end_request: changing sx8 (take 4) ...
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2483a05231c7..b71c3900810d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -464,6 +464,8 @@ enum {
464#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) 464#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
465#define blk_bidi_rq(rq) ((rq)->next_rq != NULL) 465#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
466#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) 466#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors)
467/* rq->queuelist of dequeued request must be list_empty() */
468#define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist))
467 469
468#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 470#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
469 471
@@ -643,29 +645,32 @@ static inline void blk_run_address_space(struct address_space *mapping)
643} 645}
644 646
645/* 647/*
646 * end_request() and friends. Must be called with the request queue spinlock 648 * blk_end_request() and friends.
647 * acquired. All functions called within end_request() _must_be_ atomic. 649 * __blk_end_request() and end_request() must be called with
650 * the request queue spinlock acquired.
648 * 651 *
649 * Several drivers define their own end_request and call 652 * Several drivers define their own end_request and call
650 * end_that_request_first() and end_that_request_last() 653 * blk_end_request() for parts of the original function.
651 * for parts of the original function. This prevents 654 * This prevents code duplication in drivers.
652 * code duplication in drivers.
653 */ 655 */
654extern int end_that_request_first(struct request *, int, int); 656extern int blk_end_request(struct request *rq, int error, int nr_bytes);
655extern int end_that_request_chunk(struct request *, int, int); 657extern int __blk_end_request(struct request *rq, int error, int nr_bytes);
656extern void end_that_request_last(struct request *, int); 658extern int blk_end_bidi_request(struct request *rq, int error, int nr_bytes,
659 int bidi_bytes);
657extern void end_request(struct request *, int); 660extern void end_request(struct request *, int);
658extern void end_queued_request(struct request *, int); 661extern void end_queued_request(struct request *, int);
659extern void end_dequeued_request(struct request *, int); 662extern void end_dequeued_request(struct request *, int);
663extern int blk_end_request_callback(struct request *rq, int error, int nr_bytes,
664 int (drv_callback)(struct request *));
660extern void blk_complete_request(struct request *); 665extern void blk_complete_request(struct request *);
661 666
662/* 667/*
663 * end_that_request_first/chunk() takes an uptodate argument. we account 668 * blk_end_request() takes bytes instead of sectors as a complete size.
664 * any value <= as an io error. 0 means -EIO for compatability reasons, 669 * blk_rq_bytes() returns bytes left to complete in the entire request.
665 * any other < 0 value is the direct error type. An uptodate value of 670 * blk_rq_cur_bytes() returns bytes left to complete in the current segment.
666 * 1 indicates successful io completion
667 */ 671 */
668#define end_io_error(uptodate) (unlikely((uptodate) <= 0)) 672extern unsigned int blk_rq_bytes(struct request *rq);
673extern unsigned int blk_rq_cur_bytes(struct request *rq);
669 674
670static inline void blkdev_dequeue_request(struct request *req) 675static inline void blkdev_dequeue_request(struct request *req)
671{ 676{