diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6a967cad89fa..4e5f85598728 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -832,13 +832,30 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
832 | extern void blkdev_dequeue_request(struct request *req); | 832 | extern void blkdev_dequeue_request(struct request *req); |
833 | 833 | ||
834 | /* | 834 | /* |
835 | * blk_end_request() takes bytes instead of sectors as a complete size. | 835 | * blk_rq_pos() : the current sector |
836 | * blk_rq_bytes() returns bytes left to complete in the entire request. | 836 | * blk_rq_bytes() : bytes left in the entire request |
837 | * blk_rq_cur_bytes() returns bytes left to complete in the current segment. | 837 | * blk_rq_cur_bytes() : bytes left in the current segment |
838 | * blk_rq_sectors() : sectors left in the entire request | ||
839 | * blk_rq_cur_sectors() : sectors left in the current segment | ||
838 | */ | 840 | */ |
841 | static inline sector_t blk_rq_pos(const struct request *rq) | ||
842 | { | ||
843 | return rq->hard_sector; | ||
844 | } | ||
845 | |||
839 | extern unsigned int blk_rq_bytes(struct request *rq); | 846 | extern unsigned int blk_rq_bytes(struct request *rq); |
840 | extern unsigned int blk_rq_cur_bytes(struct request *rq); | 847 | extern unsigned int blk_rq_cur_bytes(struct request *rq); |
841 | 848 | ||
849 | static inline unsigned int blk_rq_sectors(const struct request *rq) | ||
850 | { | ||
851 | return rq->hard_nr_sectors; | ||
852 | } | ||
853 | |||
854 | static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | ||
855 | { | ||
856 | return rq->hard_cur_sectors; | ||
857 | } | ||
858 | |||
842 | /* | 859 | /* |
843 | * Request completion related functions. | 860 | * Request completion related functions. |
844 | * | 861 | * |