diff options
-rw-r--r-- | include/linux/blkdev.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6e59d3b92ff2..1069f4483c6e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -910,8 +910,12 @@ static inline bool blk_end_request(struct request *rq, int error, | |||
910 | static inline void blk_end_request_all(struct request *rq, int error) | 910 | static inline void blk_end_request_all(struct request *rq, int error) |
911 | { | 911 | { |
912 | bool pending; | 912 | bool pending; |
913 | unsigned int bidi_bytes = 0; | ||
913 | 914 | ||
914 | pending = blk_end_request(rq, error, blk_rq_bytes(rq)); | 915 | if (unlikely(blk_bidi_rq(rq))) |
916 | bidi_bytes = blk_rq_bytes(rq->next_rq); | ||
917 | |||
918 | pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); | ||
915 | BUG_ON(pending); | 919 | BUG_ON(pending); |
916 | } | 920 | } |
917 | 921 | ||
@@ -962,8 +966,12 @@ static inline bool __blk_end_request(struct request *rq, int error, | |||
962 | static inline void __blk_end_request_all(struct request *rq, int error) | 966 | static inline void __blk_end_request_all(struct request *rq, int error) |
963 | { | 967 | { |
964 | bool pending; | 968 | bool pending; |
969 | unsigned int bidi_bytes = 0; | ||
970 | |||
971 | if (unlikely(blk_bidi_rq(rq))) | ||
972 | bidi_bytes = blk_rq_bytes(rq->next_rq); | ||
965 | 973 | ||
966 | pending = __blk_end_request(rq, error, blk_rq_bytes(rq)); | 974 | pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); |
967 | BUG_ON(pending); | 975 | BUG_ON(pending); |
968 | } | 976 | } |
969 | 977 | ||