diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8089ca17db9a..0ce8a372d506 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -135,7 +135,7 @@ typedef __u32 __bitwise req_flags_t; | |||
135 | struct request { | 135 | struct request { |
136 | struct list_head queuelist; | 136 | struct list_head queuelist; |
137 | union { | 137 | union { |
138 | call_single_data_t csd; | 138 | struct __call_single_data csd; |
139 | u64 fifo_time; | 139 | u64 fifo_time; |
140 | }; | 140 | }; |
141 | 141 | ||
@@ -241,14 +241,24 @@ struct request { | |||
241 | struct request *next_rq; | 241 | struct request *next_rq; |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static inline bool blk_op_is_scsi(unsigned int op) | ||
245 | { | ||
246 | return op == REQ_OP_SCSI_IN || op == REQ_OP_SCSI_OUT; | ||
247 | } | ||
248 | |||
249 | static inline bool blk_op_is_private(unsigned int op) | ||
250 | { | ||
251 | return op == REQ_OP_DRV_IN || op == REQ_OP_DRV_OUT; | ||
252 | } | ||
253 | |||
244 | static inline bool blk_rq_is_scsi(struct request *rq) | 254 | static inline bool blk_rq_is_scsi(struct request *rq) |
245 | { | 255 | { |
246 | return req_op(rq) == REQ_OP_SCSI_IN || req_op(rq) == REQ_OP_SCSI_OUT; | 256 | return blk_op_is_scsi(req_op(rq)); |
247 | } | 257 | } |
248 | 258 | ||
249 | static inline bool blk_rq_is_private(struct request *rq) | 259 | static inline bool blk_rq_is_private(struct request *rq) |
250 | { | 260 | { |
251 | return req_op(rq) == REQ_OP_DRV_IN || req_op(rq) == REQ_OP_DRV_OUT; | 261 | return blk_op_is_private(req_op(rq)); |
252 | } | 262 | } |
253 | 263 | ||
254 | static inline bool blk_rq_is_passthrough(struct request *rq) | 264 | static inline bool blk_rq_is_passthrough(struct request *rq) |
@@ -256,6 +266,13 @@ static inline bool blk_rq_is_passthrough(struct request *rq) | |||
256 | return blk_rq_is_scsi(rq) || blk_rq_is_private(rq); | 266 | return blk_rq_is_scsi(rq) || blk_rq_is_private(rq); |
257 | } | 267 | } |
258 | 268 | ||
269 | static inline bool bio_is_passthrough(struct bio *bio) | ||
270 | { | ||
271 | unsigned op = bio_op(bio); | ||
272 | |||
273 | return blk_op_is_scsi(op) || blk_op_is_private(op); | ||
274 | } | ||
275 | |||
259 | static inline unsigned short req_get_ioprio(struct request *req) | 276 | static inline unsigned short req_get_ioprio(struct request *req) |
260 | { | 277 | { |
261 | return req->ioprio; | 278 | return req->ioprio; |
@@ -948,7 +965,7 @@ extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src, | |||
948 | extern void blk_rq_unprep_clone(struct request *rq); | 965 | extern void blk_rq_unprep_clone(struct request *rq); |
949 | extern blk_status_t blk_insert_cloned_request(struct request_queue *q, | 966 | extern blk_status_t blk_insert_cloned_request(struct request_queue *q, |
950 | struct request *rq); | 967 | struct request *rq); |
951 | extern int blk_rq_append_bio(struct request *rq, struct bio *bio); | 968 | extern int blk_rq_append_bio(struct request *rq, struct bio **bio); |
952 | extern void blk_delay_queue(struct request_queue *, unsigned long); | 969 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
953 | extern void blk_queue_split(struct request_queue *, struct bio **); | 970 | extern void blk_queue_split(struct request_queue *, struct bio **); |
954 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 971 | extern void blk_recount_segments(struct request_queue *, struct bio *); |