diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c3015736d814..650b6a9cb679 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -115,6 +115,7 @@ enum rq_flag_bits { | |||
115 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ | 115 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ |
116 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ | 116 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ |
117 | __REQ_IO_STAT, /* account I/O stat */ | 117 | __REQ_IO_STAT, /* account I/O stat */ |
118 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | ||
118 | __REQ_NR_BITS, /* stops here */ | 119 | __REQ_NR_BITS, /* stops here */ |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -143,6 +144,7 @@ enum rq_flag_bits { | |||
143 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) | 144 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) |
144 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) | 145 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) |
145 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 146 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
147 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | ||
146 | 148 | ||
147 | #define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \ | 149 | #define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \ |
148 | REQ_FAILFAST_DRIVER) | 150 | REQ_FAILFAST_DRIVER) |
@@ -832,11 +834,13 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
832 | } | 834 | } |
833 | 835 | ||
834 | /* | 836 | /* |
835 | * blk_rq_pos() : the current sector | 837 | * blk_rq_pos() : the current sector |
836 | * blk_rq_bytes() : bytes left in the entire request | 838 | * blk_rq_bytes() : bytes left in the entire request |
837 | * blk_rq_cur_bytes() : bytes left in the current segment | 839 | * blk_rq_cur_bytes() : bytes left in the current segment |
838 | * blk_rq_sectors() : sectors left in the entire request | 840 | * blk_rq_err_bytes() : bytes left till the next error boundary |
839 | * blk_rq_cur_sectors() : sectors left in the current segment | 841 | * blk_rq_sectors() : sectors left in the entire request |
842 | * blk_rq_cur_sectors() : sectors left in the current segment | ||
843 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
840 | */ | 844 | */ |
841 | static inline sector_t blk_rq_pos(const struct request *rq) | 845 | static inline sector_t blk_rq_pos(const struct request *rq) |
842 | { | 846 | { |
@@ -853,6 +857,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq) | |||
853 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; | 857 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; |
854 | } | 858 | } |
855 | 859 | ||
860 | extern unsigned int blk_rq_err_bytes(const struct request *rq); | ||
861 | |||
856 | static inline unsigned int blk_rq_sectors(const struct request *rq) | 862 | static inline unsigned int blk_rq_sectors(const struct request *rq) |
857 | { | 863 | { |
858 | return blk_rq_bytes(rq) >> 9; | 864 | return blk_rq_bytes(rq) >> 9; |
@@ -863,6 +869,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
863 | return blk_rq_cur_bytes(rq) >> 9; | 869 | return blk_rq_cur_bytes(rq) >> 9; |
864 | } | 870 | } |
865 | 871 | ||
872 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
873 | { | ||
874 | return blk_rq_err_bytes(rq) >> 9; | ||
875 | } | ||
876 | |||
866 | /* | 877 | /* |
867 | * Request issue related functions. | 878 | * Request issue related functions. |
868 | */ | 879 | */ |
@@ -889,10 +900,12 @@ extern bool blk_end_request(struct request *rq, int error, | |||
889 | unsigned int nr_bytes); | 900 | unsigned int nr_bytes); |
890 | extern void blk_end_request_all(struct request *rq, int error); | 901 | extern void blk_end_request_all(struct request *rq, int error); |
891 | extern bool blk_end_request_cur(struct request *rq, int error); | 902 | extern bool blk_end_request_cur(struct request *rq, int error); |
903 | extern bool blk_end_request_err(struct request *rq, int error); | ||
892 | extern bool __blk_end_request(struct request *rq, int error, | 904 | extern bool __blk_end_request(struct request *rq, int error, |
893 | unsigned int nr_bytes); | 905 | unsigned int nr_bytes); |
894 | extern void __blk_end_request_all(struct request *rq, int error); | 906 | extern void __blk_end_request_all(struct request *rq, int error); |
895 | extern bool __blk_end_request_cur(struct request *rq, int error); | 907 | extern bool __blk_end_request_cur(struct request *rq, int error); |
908 | extern bool __blk_end_request_err(struct request *rq, int error); | ||
896 | 909 | ||
897 | extern void blk_complete_request(struct request *); | 910 | extern void blk_complete_request(struct request *); |
898 | extern void __blk_complete_request(struct request *); | 911 | extern void __blk_complete_request(struct request *); |