diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-30 11:46:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-30 11:46:42 -0500 |
commit | ae704e9f92f87b12c5938b07245792857c7c9c14 (patch) | |
tree | b30f065b6bc815a0c0ce7ccb7d1c8a74b7e14b08 /include | |
parent | dbeb17016e4d0affccfa07f4e8f61feac75c5a18 (diff) | |
parent | 3a9a3f6cc55418dd1525e636dccbbe13c394f652 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cfq-iosched: Allow RT requests to pre-empt ongoing BE timeslice
block: add sysfs file for controlling io stats accounting
Mark mandatory elevator functions in the biodoc.txt
include/linux: Add bsg.h to the Kernel exported headers
block: silently error an unsupported barrier bio
block: Fix documentation for blkdev_issue_flush()
block: add bio_rw_flagged() for testing bio->bi_rw
block: seperate bio/request unplug and sync bits
block: export SSD/non-rotational queue flag through sysfs
Fix small typo in bio.h's documentation
block: get rid of the manual directory counting in blktrace
block: Allow empty integrity profile
block: Remove obsolete BUG_ON
block: Don't verify integrity metadata on read error
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/bio.h | 45 | ||||
-rw-r--r-- | include/linux/blkdev.h | 8 |
3 files changed, 37 insertions, 17 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 12e9a2957caf..2124c063a7ef 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -41,6 +41,7 @@ header-y += baycom.h | |||
41 | header-y += bfs_fs.h | 41 | header-y += bfs_fs.h |
42 | header-y += blkpg.h | 42 | header-y += blkpg.h |
43 | header-y += bpqether.h | 43 | header-y += bpqether.h |
44 | header-y += bsg.h | ||
44 | header-y += can.h | 45 | header-y += can.h |
45 | header-y += cdk.h | 46 | header-y += cdk.h |
46 | header-y += chio.h | 47 | header-y += chio.h |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 18462c5b8fff..0942765cf8c0 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -144,7 +144,7 @@ struct bio { | |||
144 | * bit 1 -- rw-ahead when set | 144 | * bit 1 -- rw-ahead when set |
145 | * bit 2 -- barrier | 145 | * bit 2 -- barrier |
146 | * Insert a serialization point in the IO queue, forcing previously | 146 | * Insert a serialization point in the IO queue, forcing previously |
147 | * submitted IO to be completed before this oen is issued. | 147 | * submitted IO to be completed before this one is issued. |
148 | * bit 3 -- synchronous I/O hint: the block layer will unplug immediately | 148 | * bit 3 -- synchronous I/O hint: the block layer will unplug immediately |
149 | * Note that this does NOT indicate that the IO itself is sync, just | 149 | * Note that this does NOT indicate that the IO itself is sync, just |
150 | * that the block layer will not postpone issue of this IO by plugging. | 150 | * that the block layer will not postpone issue of this IO by plugging. |
@@ -163,12 +163,33 @@ struct bio { | |||
163 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ | 163 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ |
164 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ | 164 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ |
165 | #define BIO_RW_BARRIER 2 | 165 | #define BIO_RW_BARRIER 2 |
166 | #define BIO_RW_SYNC 3 | 166 | #define BIO_RW_SYNCIO 3 |
167 | #define BIO_RW_META 4 | 167 | #define BIO_RW_UNPLUG 4 |
168 | #define BIO_RW_DISCARD 5 | 168 | #define BIO_RW_META 5 |
169 | #define BIO_RW_FAILFAST_DEV 6 | 169 | #define BIO_RW_DISCARD 6 |
170 | #define BIO_RW_FAILFAST_TRANSPORT 7 | 170 | #define BIO_RW_FAILFAST_DEV 7 |
171 | #define BIO_RW_FAILFAST_DRIVER 8 | 171 | #define BIO_RW_FAILFAST_TRANSPORT 8 |
172 | #define BIO_RW_FAILFAST_DRIVER 9 | ||
173 | |||
174 | #define BIO_RW_SYNC (BIO_RW_SYNCIO | BIO_RW_UNPLUG) | ||
175 | |||
176 | #define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) | ||
177 | |||
178 | /* | ||
179 | * Old defines, these should eventually be replaced by direct usage of | ||
180 | * bio_rw_flagged() | ||
181 | */ | ||
182 | #define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER) | ||
183 | #define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO) | ||
184 | #define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG) | ||
185 | #define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV) | ||
186 | #define bio_failfast_transport(bio) \ | ||
187 | bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT) | ||
188 | #define bio_failfast_driver(bio) \ | ||
189 | bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER) | ||
190 | #define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD) | ||
191 | #define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META) | ||
192 | #define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD) | ||
172 | 193 | ||
173 | /* | 194 | /* |
174 | * upper 16 bits of bi_rw define the io priority of this bio | 195 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -193,15 +214,6 @@ struct bio { | |||
193 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 214 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
194 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 215 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
195 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 216 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
196 | #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) | ||
197 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | ||
198 | #define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV)) | ||
199 | #define bio_failfast_transport(bio) \ | ||
200 | ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT)) | ||
201 | #define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER)) | ||
202 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | ||
203 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | ||
204 | #define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) | ||
205 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | 217 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) |
206 | 218 | ||
207 | static inline unsigned int bio_cur_sectors(struct bio *bio) | 219 | static inline unsigned int bio_cur_sectors(struct bio *bio) |
@@ -312,7 +324,6 @@ struct bio_integrity_payload { | |||
312 | void *bip_buf; /* generated integrity data */ | 324 | void *bip_buf; /* generated integrity data */ |
313 | bio_end_io_t *bip_end_io; /* saved I/O completion fn */ | 325 | bio_end_io_t *bip_end_io; /* saved I/O completion fn */ |
314 | 326 | ||
315 | int bip_error; /* saved I/O error */ | ||
316 | unsigned int bip_size; | 327 | unsigned int bip_size; |
317 | 328 | ||
318 | unsigned short bip_pool; /* pool the ivec came from */ | 329 | unsigned short bip_pool; /* pool the ivec came from */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 044467ef7b11..d08c4b8219a6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -108,6 +108,7 @@ enum rq_flag_bits { | |||
108 | __REQ_RW_META, /* metadata io request */ | 108 | __REQ_RW_META, /* metadata io request */ |
109 | __REQ_COPY_USER, /* contains copies of user pages */ | 109 | __REQ_COPY_USER, /* contains copies of user pages */ |
110 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ | 110 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ |
111 | __REQ_UNPLUG, /* unplug queue on submission */ | ||
111 | __REQ_NR_BITS, /* stops here */ | 112 | __REQ_NR_BITS, /* stops here */ |
112 | }; | 113 | }; |
113 | 114 | ||
@@ -134,6 +135,7 @@ enum rq_flag_bits { | |||
134 | #define REQ_RW_META (1 << __REQ_RW_META) | 135 | #define REQ_RW_META (1 << __REQ_RW_META) |
135 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) | 136 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) |
136 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) | 137 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) |
138 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | ||
137 | 139 | ||
138 | #define BLK_MAX_CDB 16 | 140 | #define BLK_MAX_CDB 16 |
139 | 141 | ||
@@ -449,6 +451,11 @@ struct request_queue | |||
449 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 451 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ |
450 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 452 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
451 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 453 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
454 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | ||
455 | |||
456 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | ||
457 | (1 << QUEUE_FLAG_CLUSTER) | \ | ||
458 | 1 << QUEUE_FLAG_STACKABLE) | ||
452 | 459 | ||
453 | static inline int queue_is_locked(struct request_queue *q) | 460 | static inline int queue_is_locked(struct request_queue *q) |
454 | { | 461 | { |
@@ -565,6 +572,7 @@ enum { | |||
565 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 572 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
566 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 573 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
567 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 574 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
575 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) | ||
568 | #define blk_queue_flushing(q) ((q)->ordseq) | 576 | #define blk_queue_flushing(q) ((q)->ordseq) |
569 | #define blk_queue_stackable(q) \ | 577 | #define blk_queue_stackable(q) \ |
570 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | 578 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) |