aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:18:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:18:03 -0400
commitbd5d435a96837c3495e62eef37cbe4cb728b79ae (patch)
tree82aacaf5a1d220910c4b0a1088d7d2482c0d9ee0 /include/linux
parentfee4b19fb3f28d17c0b9f9ea0668db5275697178 (diff)
parentac9fafa1243640349aa481adf473db283a695766 (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: block: Skip I/O merges when disabled block: add large command support block: replace sizeof(rq->cmd) with BLK_MAX_CDB ide: use blk_rq_init() to initialize the request block: use blk_rq_init() to initialize the request block: rename and export rq_init() block: no need to initialize rq->cmd with blk_get_request block: no need to initialize rq->cmd in prepare_flush_fn hook block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline block/elevator.c:elv_rq_merge_ok() mustn't be inline block: make queue flags non-atomic block: add dma alignment and padding support to blk_rq_map_kern unexport blk_max_pfn ps3disk: Remove superfluous cast block: make rq_init() do a full memset() relay: fix splice problem
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/blkdev.h41
2 files changed, 37 insertions, 6 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index d259690863fb..61c15eaf3fb3 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -324,6 +324,8 @@ extern struct bio *bio_map_user_iov(struct request_queue *,
324extern void bio_unmap_user(struct bio *); 324extern void bio_unmap_user(struct bio *);
325extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, 325extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
326 gfp_t); 326 gfp_t);
327extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
328 gfp_t, int);
327extern void bio_set_pages_dirty(struct bio *bio); 329extern void bio_set_pages_dirty(struct bio *bio);
328extern void bio_check_pages_dirty(struct bio *bio); 330extern void bio_check_pages_dirty(struct bio *bio);
329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 331extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c5065e3d2ca9..c09696a90d6a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -215,8 +215,9 @@ struct request {
215 /* 215 /*
216 * when request is used as a packet command carrier 216 * when request is used as a packet command carrier
217 */ 217 */
218 unsigned int cmd_len; 218 unsigned short cmd_len;
219 unsigned char cmd[BLK_MAX_CDB]; 219 unsigned char __cmd[BLK_MAX_CDB];
220 unsigned char *cmd;
220 221
221 unsigned int data_len; 222 unsigned int data_len;
222 unsigned int extra_len; /* length of alignment and padding */ 223 unsigned int extra_len; /* length of alignment and padding */
@@ -407,6 +408,31 @@ struct request_queue
407#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 408#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
408#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ 409#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
409#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ 410#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
411#define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */
412
413static inline void queue_flag_set_unlocked(unsigned int flag,
414 struct request_queue *q)
415{
416 __set_bit(flag, &q->queue_flags);
417}
418
419static inline void queue_flag_set(unsigned int flag, struct request_queue *q)
420{
421 WARN_ON_ONCE(!spin_is_locked(q->queue_lock));
422 __set_bit(flag, &q->queue_flags);
423}
424
425static inline void queue_flag_clear_unlocked(unsigned int flag,
426 struct request_queue *q)
427{
428 __clear_bit(flag, &q->queue_flags);
429}
430
431static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
432{
433 WARN_ON_ONCE(!spin_is_locked(q->queue_lock));
434 __clear_bit(flag, &q->queue_flags);
435}
410 436
411enum { 437enum {
412 /* 438 /*
@@ -451,6 +477,7 @@ enum {
451#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 477#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
452#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 478#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
453#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 479#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
480#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
454#define blk_queue_flushing(q) ((q)->ordseq) 481#define blk_queue_flushing(q) ((q)->ordseq)
455 482
456#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) 483#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
@@ -496,17 +523,17 @@ static inline int blk_queue_full(struct request_queue *q, int rw)
496static inline void blk_set_queue_full(struct request_queue *q, int rw) 523static inline void blk_set_queue_full(struct request_queue *q, int rw)
497{ 524{
498 if (rw == READ) 525 if (rw == READ)
499 set_bit(QUEUE_FLAG_READFULL, &q->queue_flags); 526 queue_flag_set(QUEUE_FLAG_READFULL, q);
500 else 527 else
501 set_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags); 528 queue_flag_set(QUEUE_FLAG_WRITEFULL, q);
502} 529}
503 530
504static inline void blk_clear_queue_full(struct request_queue *q, int rw) 531static inline void blk_clear_queue_full(struct request_queue *q, int rw)
505{ 532{
506 if (rw == READ) 533 if (rw == READ)
507 clear_bit(QUEUE_FLAG_READFULL, &q->queue_flags); 534 queue_flag_clear(QUEUE_FLAG_READFULL, q);
508 else 535 else
509 clear_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags); 536 queue_flag_clear(QUEUE_FLAG_WRITEFULL, q);
510} 537}
511 538
512 539
@@ -583,6 +610,7 @@ extern int blk_register_queue(struct gendisk *disk);
583extern void blk_unregister_queue(struct gendisk *disk); 610extern void blk_unregister_queue(struct gendisk *disk);
584extern void register_disk(struct gendisk *dev); 611extern void register_disk(struct gendisk *dev);
585extern void generic_make_request(struct bio *bio); 612extern void generic_make_request(struct bio *bio);
613extern void blk_rq_init(struct request_queue *q, struct request *rq);
586extern void blk_put_request(struct request *); 614extern void blk_put_request(struct request *);
587extern void __blk_put_request(struct request_queue *, struct request *); 615extern void __blk_put_request(struct request_queue *, struct request *);
588extern void blk_end_sync_rq(struct request *rq, int error); 616extern void blk_end_sync_rq(struct request *rq, int error);
@@ -626,6 +654,7 @@ extern void blk_start_queue(struct request_queue *q);
626extern void blk_stop_queue(struct request_queue *q); 654extern void blk_stop_queue(struct request_queue *q);
627extern void blk_sync_queue(struct request_queue *q); 655extern void blk_sync_queue(struct request_queue *q);
628extern void __blk_stop_queue(struct request_queue *q); 656extern void __blk_stop_queue(struct request_queue *q);
657extern void __blk_run_queue(struct request_queue *);
629extern void blk_run_queue(struct request_queue *); 658extern void blk_run_queue(struct request_queue *);
630extern void blk_start_queueing(struct request_queue *); 659extern void blk_start_queueing(struct request_queue *);
631extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long); 660extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long);