diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 41 | ||||
-rw-r--r-- | include/linux/blktrace_api.h | 2 | ||||
-rw-r--r-- | include/trace/events/block.h | 15 |
3 files changed, 24 insertions, 34 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d7ae241a9e55..3ecd28ef9ba4 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -604,33 +604,20 @@ enum { | |||
604 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | 604 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) |
605 | #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) | 605 | #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) |
606 | 606 | ||
607 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) | 607 | #define blk_noretry_request(rq) \ |
608 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) | 608 | ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \ |
609 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) | 609 | REQ_FAILFAST_DRIVER)) |
610 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) | 610 | |
611 | 611 | #define blk_account_rq(rq) \ | |
612 | #define blk_failfast_dev(rq) ((rq)->cmd_flags & REQ_FAILFAST_DEV) | 612 | (((rq)->cmd_flags & REQ_STARTED) && \ |
613 | #define blk_failfast_transport(rq) ((rq)->cmd_flags & REQ_FAILFAST_TRANSPORT) | 613 | ((rq)->cmd_type == REQ_TYPE_FS || \ |
614 | #define blk_failfast_driver(rq) ((rq)->cmd_flags & REQ_FAILFAST_DRIVER) | 614 | ((rq)->cmd_flags & REQ_DISCARD))) |
615 | #define blk_noretry_request(rq) (blk_failfast_dev(rq) || \ | 615 | |
616 | blk_failfast_transport(rq) || \ | ||
617 | blk_failfast_driver(rq)) | ||
618 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | ||
619 | #define blk_rq_io_stat(rq) ((rq)->cmd_flags & REQ_IO_STAT) | ||
620 | #define blk_rq_quiet(rq) ((rq)->cmd_flags & REQ_QUIET) | ||
621 | |||
622 | #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) | ||
623 | |||
624 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) | ||
625 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) | ||
626 | #define blk_pm_request(rq) \ | 616 | #define blk_pm_request(rq) \ |
627 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) | 617 | ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND || \ |
618 | (rq)->cmd_type == REQ_TYPE_PM_RESUME) | ||
628 | 619 | ||
629 | #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) | 620 | #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) |
630 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | ||
631 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | ||
632 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | ||
633 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | ||
634 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 621 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
635 | /* rq->queuelist of dequeued request must be list_empty() */ | 622 | /* rq->queuelist of dequeued request must be list_empty() */ |
636 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) | 623 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) |
@@ -652,9 +639,6 @@ static inline bool rq_is_sync(struct request *rq) | |||
652 | return rw_is_sync(rq->cmd_flags); | 639 | return rw_is_sync(rq->cmd_flags); |
653 | } | 640 | } |
654 | 641 | ||
655 | #define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META) | ||
656 | #define rq_noidle(rq) ((rq)->cmd_flags & REQ_NOIDLE) | ||
657 | |||
658 | static inline int blk_queue_full(struct request_queue *q, int sync) | 642 | static inline int blk_queue_full(struct request_queue *q, int sync) |
659 | { | 643 | { |
660 | if (sync) | 644 | if (sync) |
@@ -687,7 +671,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync) | |||
687 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 671 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
688 | #define rq_mergeable(rq) \ | 672 | #define rq_mergeable(rq) \ |
689 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ | 673 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
690 | (blk_discard_rq(rq) || blk_fs_request((rq)))) | 674 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
675 | (rq)->cmd_type == REQ_TYPE_FS)) | ||
691 | 676 | ||
692 | /* | 677 | /* |
693 | * q->prep_rq_fn return values | 678 | * q->prep_rq_fn return values |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 416bf62d6d46..23faa67e8022 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -224,7 +224,7 @@ static inline int blk_trace_init_sysfs(struct device *dev) | |||
224 | 224 | ||
225 | static inline int blk_cmd_buf_len(struct request *rq) | 225 | static inline int blk_cmd_buf_len(struct request *rq) |
226 | { | 226 | { |
227 | return blk_pc_request(rq) ? rq->cmd_len * 3 : 1; | 227 | return (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? rq->cmd_len * 3 : 1; |
228 | } | 228 | } |
229 | 229 | ||
230 | extern void blk_dump_cmd(char *buf, struct request *rq); | 230 | extern void blk_dump_cmd(char *buf, struct request *rq); |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d870a918559c..d8ce278515c3 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -25,8 +25,10 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
25 | 25 | ||
26 | TP_fast_assign( | 26 | TP_fast_assign( |
27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
28 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 28 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
29 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 29 | 0 : blk_rq_pos(rq); |
30 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
31 | 0 : blk_rq_sectors(rq); | ||
30 | __entry->errors = rq->errors; | 32 | __entry->errors = rq->errors; |
31 | 33 | ||
32 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 34 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
@@ -109,9 +111,12 @@ DECLARE_EVENT_CLASS(block_rq, | |||
109 | 111 | ||
110 | TP_fast_assign( | 112 | TP_fast_assign( |
111 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 113 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
112 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 114 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
113 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 115 | 0 : blk_rq_pos(rq); |
114 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | 116 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
117 | 0 : blk_rq_sectors(rq); | ||
118 | __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
119 | blk_rq_bytes(rq) : 0; | ||
115 | 120 | ||
116 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 121 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
117 | blk_dump_cmd(__get_str(cmd), rq); | 122 | blk_dump_cmd(__get_str(cmd), rq); |