diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-07-09 06:38:05 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-16 02:52:44 -0400 |
commit | 3d6392cfbd7dc11f23058e3493683afab4ac13a3 (patch) | |
tree | 70c2b65c479f5feb7a5214a4a4930d489a069b1f /include | |
parent | 8f41958bdd577731f7411c9605cfaa9db6766809 (diff) |
bsg: support for full generic block layer SG v3
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 12 | ||||
-rw-r--r-- | include/linux/bsg.h | 21 | ||||
-rw-r--r-- | include/linux/genhd.h | 2 |
3 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fae138bd2207..53002d40efa2 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -41,6 +41,8 @@ struct elevator_queue; | |||
41 | typedef struct elevator_queue elevator_t; | 41 | typedef struct elevator_queue elevator_t; |
42 | struct request_pm_state; | 42 | struct request_pm_state; |
43 | struct blk_trace; | 43 | struct blk_trace; |
44 | struct request; | ||
45 | struct sg_io_hdr; | ||
44 | 46 | ||
45 | #define BLKDEV_MIN_RQ 4 | 47 | #define BLKDEV_MIN_RQ 4 |
46 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 48 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
@@ -607,6 +609,11 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; | |||
607 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) | 609 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) |
608 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) | 610 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) |
609 | 611 | ||
612 | /* | ||
613 | * default timeout for SG_IO if none specified | ||
614 | */ | ||
615 | #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ) | ||
616 | |||
610 | #ifdef CONFIG_MMU | 617 | #ifdef CONFIG_MMU |
611 | extern int init_emergency_isa_pool(void); | 618 | extern int init_emergency_isa_pool(void); |
612 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); | 619 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); |
@@ -680,6 +687,11 @@ extern int blk_execute_rq(request_queue_t *, struct gendisk *, | |||
680 | struct request *, int); | 687 | struct request *, int); |
681 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, | 688 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, |
682 | struct request *, int, rq_end_io_fn *); | 689 | struct request *, int, rq_end_io_fn *); |
690 | extern int blk_fill_sghdr_rq(request_queue_t *, struct request *, | ||
691 | struct sg_io_hdr *, int); | ||
692 | extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *); | ||
693 | extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *, | ||
694 | struct bio *); | ||
683 | 695 | ||
684 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 696 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) |
685 | { | 697 | { |
diff --git a/include/linux/bsg.h b/include/linux/bsg.h new file mode 100644 index 000000000000..dc0d7282c4cb --- /dev/null +++ b/include/linux/bsg.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef BSG_H | ||
2 | #define BSG_H | ||
3 | |||
4 | #if defined(CONFIG_BLK_DEV_BSG) | ||
5 | struct bsg_class_device { | ||
6 | struct class_device *class_dev; | ||
7 | struct device *dev; | ||
8 | int minor; | ||
9 | struct gendisk *disk; | ||
10 | struct list_head list; | ||
11 | }; | ||
12 | |||
13 | extern int bsg_register_disk(struct gendisk *); | ||
14 | extern void bsg_unregister_disk(struct gendisk *); | ||
15 | #else | ||
16 | struct bsg_class_device { }; | ||
17 | #define bsg_register_disk(disk) (0) | ||
18 | #define bsg_unregister_disk(disk) do { } while (0) | ||
19 | #endif | ||
20 | |||
21 | #endif | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 9756fc102a83..8c43d7032612 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -67,6 +67,7 @@ struct partition { | |||
67 | #include <linux/string.h> | 67 | #include <linux/string.h> |
68 | #include <linux/fs.h> | 68 | #include <linux/fs.h> |
69 | #include <linux/workqueue.h> | 69 | #include <linux/workqueue.h> |
70 | #include <linux/bsg.h> | ||
70 | 71 | ||
71 | struct partition { | 72 | struct partition { |
72 | unsigned char boot_ind; /* 0x80 - active */ | 73 | unsigned char boot_ind; /* 0x80 - active */ |
@@ -91,6 +92,7 @@ struct hd_struct { | |||
91 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 92 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
92 | int make_it_fail; | 93 | int make_it_fail; |
93 | #endif | 94 | #endif |
95 | struct bsg_class_device bsg_dev; | ||
94 | }; | 96 | }; |
95 | 97 | ||
96 | #define GENHD_FL_REMOVABLE 1 | 98 | #define GENHD_FL_REMOVABLE 1 |