diff options
author | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
commit | d702d12167a2c05a346f49aac7a311d597762495 (patch) | |
tree | baae42c299cce34d6df24b5d01f8b1d0b481bd9a /include/linux/blkdev.h | |
parent | 9418c65f9bd861d0f7e39aab9cfb3aa6f2275d11 (diff) | |
parent | ac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (diff) |
Merge with mainline to remove plat-omap/Kconfig conflict
Conflicts:
arch/arm/plat-omap/Kconfig
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5c8018977efa..ebd22dbed861 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -316,8 +316,7 @@ struct queue_limits { | |||
316 | unsigned int discard_alignment; | 316 | unsigned int discard_alignment; |
317 | 317 | ||
318 | unsigned short logical_block_size; | 318 | unsigned short logical_block_size; |
319 | unsigned short max_hw_segments; | 319 | unsigned short max_segments; |
320 | unsigned short max_phys_segments; | ||
321 | 320 | ||
322 | unsigned char misaligned; | 321 | unsigned char misaligned; |
323 | unsigned char discard_misaligned; | 322 | unsigned char discard_misaligned; |
@@ -461,8 +460,8 @@ struct request_queue | |||
461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 460 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 461 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 462 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
464 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | 463 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
465 | #define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ | 464 | #define QUEUE_FLAG_NOXMERGES 17 /* No extended merges */ |
466 | 465 | ||
467 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 466 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
468 | (1 << QUEUE_FLAG_CLUSTER) | \ | 467 | (1 << QUEUE_FLAG_CLUSTER) | \ |
@@ -586,9 +585,10 @@ enum { | |||
586 | 585 | ||
587 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 586 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
588 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 587 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
589 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
590 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 588 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
591 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 589 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
590 | #define blk_queue_noxmerges(q) \ | ||
591 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) | ||
592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
593 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) | 593 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) |
594 | #define blk_queue_flushing(q) ((q)->ordseq) | 594 | #define blk_queue_flushing(q) ((q)->ordseq) |
@@ -920,10 +920,27 @@ extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *); | |||
920 | extern void blk_cleanup_queue(struct request_queue *); | 920 | extern void blk_cleanup_queue(struct request_queue *); |
921 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); | 921 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); |
922 | extern void blk_queue_bounce_limit(struct request_queue *, u64); | 922 | extern void blk_queue_bounce_limit(struct request_queue *, u64); |
923 | extern void blk_queue_max_sectors(struct request_queue *, unsigned int); | ||
924 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); | 923 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); |
925 | extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); | 924 | |
926 | extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); | 925 | /* Temporary compatibility wrapper */ |
926 | static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max) | ||
927 | { | ||
928 | blk_queue_max_hw_sectors(q, max); | ||
929 | } | ||
930 | |||
931 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); | ||
932 | |||
933 | static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max) | ||
934 | { | ||
935 | blk_queue_max_segments(q, max); | ||
936 | } | ||
937 | |||
938 | static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max) | ||
939 | { | ||
940 | blk_queue_max_segments(q, max); | ||
941 | } | ||
942 | |||
943 | |||
927 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 944 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
928 | extern void blk_queue_max_discard_sectors(struct request_queue *q, | 945 | extern void blk_queue_max_discard_sectors(struct request_queue *q, |
929 | unsigned int max_discard_sectors); | 946 | unsigned int max_discard_sectors); |
@@ -1016,11 +1033,15 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | |||
1016 | #define MAX_PHYS_SEGMENTS 128 | 1033 | #define MAX_PHYS_SEGMENTS 128 |
1017 | #define MAX_HW_SEGMENTS 128 | 1034 | #define MAX_HW_SEGMENTS 128 |
1018 | #define SAFE_MAX_SECTORS 255 | 1035 | #define SAFE_MAX_SECTORS 255 |
1019 | #define BLK_DEF_MAX_SECTORS 1024 | ||
1020 | |||
1021 | #define MAX_SEGMENT_SIZE 65536 | 1036 | #define MAX_SEGMENT_SIZE 65536 |
1022 | 1037 | ||
1023 | #define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL | 1038 | enum blk_default_limits { |
1039 | BLK_MAX_SEGMENTS = 128, | ||
1040 | BLK_SAFE_MAX_SECTORS = 255, | ||
1041 | BLK_DEF_MAX_SECTORS = 1024, | ||
1042 | BLK_MAX_SEGMENT_SIZE = 65536, | ||
1043 | BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, | ||
1044 | }; | ||
1024 | 1045 | ||
1025 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) | 1046 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) |
1026 | 1047 | ||
@@ -1044,14 +1065,9 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) | |||
1044 | return q->limits.max_hw_sectors; | 1065 | return q->limits.max_hw_sectors; |
1045 | } | 1066 | } |
1046 | 1067 | ||
1047 | static inline unsigned short queue_max_hw_segments(struct request_queue *q) | 1068 | static inline unsigned short queue_max_segments(struct request_queue *q) |
1048 | { | ||
1049 | return q->limits.max_hw_segments; | ||
1050 | } | ||
1051 | |||
1052 | static inline unsigned short queue_max_phys_segments(struct request_queue *q) | ||
1053 | { | 1069 | { |
1054 | return q->limits.max_phys_segments; | 1070 | return q->limits.max_segments; |
1055 | } | 1071 | } |
1056 | 1072 | ||
1057 | static inline unsigned int queue_max_segment_size(struct request_queue *q) | 1073 | static inline unsigned int queue_max_segment_size(struct request_queue *q) |
@@ -1112,18 +1128,13 @@ static inline int queue_alignment_offset(struct request_queue *q) | |||
1112 | return q->limits.alignment_offset; | 1128 | return q->limits.alignment_offset; |
1113 | } | 1129 | } |
1114 | 1130 | ||
1115 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t offset) | 1131 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector) |
1116 | { | 1132 | { |
1117 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); | 1133 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); |
1134 | unsigned int alignment = (sector << 9) & (granularity - 1); | ||
1118 | 1135 | ||
1119 | offset &= granularity - 1; | 1136 | return (granularity + lim->alignment_offset - alignment) |
1120 | return (granularity + lim->alignment_offset - offset) & (granularity - 1); | 1137 | & (granularity - 1); |
1121 | } | ||
1122 | |||
1123 | static inline int queue_sector_alignment_offset(struct request_queue *q, | ||
1124 | sector_t sector) | ||
1125 | { | ||
1126 | return queue_limit_alignment_offset(&q->limits, sector << 9); | ||
1127 | } | 1138 | } |
1128 | 1139 | ||
1129 | static inline int bdev_alignment_offset(struct block_device *bdev) | 1140 | static inline int bdev_alignment_offset(struct block_device *bdev) |
@@ -1147,10 +1158,8 @@ static inline int queue_discard_alignment(struct request_queue *q) | |||
1147 | return q->limits.discard_alignment; | 1158 | return q->limits.discard_alignment; |
1148 | } | 1159 | } |
1149 | 1160 | ||
1150 | static inline int queue_sector_discard_alignment(struct request_queue *q, | 1161 | static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector) |
1151 | sector_t sector) | ||
1152 | { | 1162 | { |
1153 | struct queue_limits *lim = &q->limits; | ||
1154 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); | 1163 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
1155 | 1164 | ||
1156 | return (lim->discard_granularity + lim->discard_alignment - alignment) | 1165 | return (lim->discard_granularity + lim->discard_alignment - alignment) |