diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blk_types.h | 7 | ||||
-rw-r--r-- | include/linux/blkdev.h | 5 | ||||
-rw-r--r-- | include/linux/blktrace_api.h | 5 | ||||
-rw-r--r-- | include/linux/bsg-lib.h | 73 | ||||
-rw-r--r-- | include/linux/loop.h | 5 | ||||
-rw-r--r-- | include/linux/miscdevice.h | 1 | ||||
-rw-r--r-- | include/trace/events/block.h | 20 |
7 files changed, 101 insertions, 15 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 6395692b2e7..32f0076e844 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -125,7 +125,11 @@ enum rq_flag_bits { | |||
125 | __REQ_SYNC, /* request is sync (sync write or read) */ | 125 | __REQ_SYNC, /* request is sync (sync write or read) */ |
126 | __REQ_META, /* metadata io request */ | 126 | __REQ_META, /* metadata io request */ |
127 | __REQ_DISCARD, /* request to discard sectors */ | 127 | __REQ_DISCARD, /* request to discard sectors */ |
128 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | ||
129 | |||
128 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ | 130 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ |
131 | __REQ_FUA, /* forced unit access */ | ||
132 | __REQ_FLUSH, /* request for cache flush */ | ||
129 | 133 | ||
130 | /* bio only flags */ | 134 | /* bio only flags */ |
131 | __REQ_RAHEAD, /* read ahead, can fail anytime */ | 135 | __REQ_RAHEAD, /* read ahead, can fail anytime */ |
@@ -135,7 +139,6 @@ enum rq_flag_bits { | |||
135 | /* request only flags */ | 139 | /* request only flags */ |
136 | __REQ_SORTED, /* elevator knows about this request */ | 140 | __REQ_SORTED, /* elevator knows about this request */ |
137 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 141 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
138 | __REQ_FUA, /* forced unit access */ | ||
139 | __REQ_NOMERGE, /* don't touch this for merging */ | 142 | __REQ_NOMERGE, /* don't touch this for merging */ |
140 | __REQ_STARTED, /* drive already may have started this one */ | 143 | __REQ_STARTED, /* drive already may have started this one */ |
141 | __REQ_DONTPREP, /* don't call prep for this one */ | 144 | __REQ_DONTPREP, /* don't call prep for this one */ |
@@ -146,11 +149,9 @@ enum rq_flag_bits { | |||
146 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | 149 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ |
147 | __REQ_ALLOCED, /* request came from our alloc pool */ | 150 | __REQ_ALLOCED, /* request came from our alloc pool */ |
148 | __REQ_COPY_USER, /* contains copies of user pages */ | 151 | __REQ_COPY_USER, /* contains copies of user pages */ |
149 | __REQ_FLUSH, /* request for cache flush */ | ||
150 | __REQ_FLUSH_SEQ, /* request for flush sequence */ | 152 | __REQ_FLUSH_SEQ, /* request for flush sequence */ |
151 | __REQ_IO_STAT, /* account I/O stat */ | 153 | __REQ_IO_STAT, /* account I/O stat */ |
152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 154 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | ||
154 | __REQ_NR_BITS, /* stops here */ | 155 | __REQ_NR_BITS, /* stops here */ |
155 | }; | 156 | }; |
156 | 157 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0e67c45b3bc..84b15d54f8c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -30,6 +30,7 @@ struct request_pm_state; | |||
30 | struct blk_trace; | 30 | struct blk_trace; |
31 | struct request; | 31 | struct request; |
32 | struct sg_io_hdr; | 32 | struct sg_io_hdr; |
33 | struct bsg_job; | ||
33 | 34 | ||
34 | #define BLKDEV_MIN_RQ 4 | 35 | #define BLKDEV_MIN_RQ 4 |
35 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 36 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
@@ -117,6 +118,7 @@ struct request { | |||
117 | struct { | 118 | struct { |
118 | unsigned int seq; | 119 | unsigned int seq; |
119 | struct list_head list; | 120 | struct list_head list; |
121 | rq_end_io_fn *saved_end_io; | ||
120 | } flush; | 122 | } flush; |
121 | }; | 123 | }; |
122 | 124 | ||
@@ -209,6 +211,7 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, | |||
209 | typedef void (softirq_done_fn)(struct request *); | 211 | typedef void (softirq_done_fn)(struct request *); |
210 | typedef int (dma_drain_needed_fn)(struct request *); | 212 | typedef int (dma_drain_needed_fn)(struct request *); |
211 | typedef int (lld_busy_fn) (struct request_queue *q); | 213 | typedef int (lld_busy_fn) (struct request_queue *q); |
214 | typedef int (bsg_job_fn) (struct bsg_job *); | ||
212 | 215 | ||
213 | enum blk_eh_timer_return { | 216 | enum blk_eh_timer_return { |
214 | BLK_EH_NOT_HANDLED, | 217 | BLK_EH_NOT_HANDLED, |
@@ -375,6 +378,8 @@ struct request_queue { | |||
375 | struct mutex sysfs_lock; | 378 | struct mutex sysfs_lock; |
376 | 379 | ||
377 | #if defined(CONFIG_BLK_DEV_BSG) | 380 | #if defined(CONFIG_BLK_DEV_BSG) |
381 | bsg_job_fn *bsg_job_fn; | ||
382 | int bsg_job_size; | ||
378 | struct bsg_class_device bsg_dev; | 383 | struct bsg_class_device bsg_dev; |
379 | #endif | 384 | #endif |
380 | 385 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 8c7c2de7631..8e9e4bc6d73 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -14,7 +14,7 @@ | |||
14 | enum blktrace_cat { | 14 | enum blktrace_cat { |
15 | BLK_TC_READ = 1 << 0, /* reads */ | 15 | BLK_TC_READ = 1 << 0, /* reads */ |
16 | BLK_TC_WRITE = 1 << 1, /* writes */ | 16 | BLK_TC_WRITE = 1 << 1, /* writes */ |
17 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | 17 | BLK_TC_FLUSH = 1 << 2, /* flush */ |
18 | BLK_TC_SYNC = 1 << 3, /* sync IO */ | 18 | BLK_TC_SYNC = 1 << 3, /* sync IO */ |
19 | BLK_TC_SYNCIO = BLK_TC_SYNC, | 19 | BLK_TC_SYNCIO = BLK_TC_SYNC, |
20 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | 20 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ |
@@ -28,8 +28,9 @@ enum blktrace_cat { | |||
28 | BLK_TC_META = 1 << 12, /* metadata */ | 28 | BLK_TC_META = 1 << 12, /* metadata */ |
29 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | 29 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ |
30 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ | 30 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ |
31 | BLK_TC_FUA = 1 << 15, /* fua requests */ | ||
31 | 32 | ||
32 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 33 | BLK_TC_END = 1 << 15, /* we've run out of bits! */ |
33 | }; | 34 | }; |
34 | 35 | ||
35 | #define BLK_TC_SHIFT (16) | 36 | #define BLK_TC_SHIFT (16) |
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h new file mode 100644 index 00000000000..f55ab8cdc10 --- /dev/null +++ b/include/linux/bsg-lib.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * BSG helper library | ||
3 | * | ||
4 | * Copyright (C) 2008 James Smart, Emulex Corporation | ||
5 | * Copyright (C) 2011 Red Hat, Inc. All rights reserved. | ||
6 | * Copyright (C) 2011 Mike Christie | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | #ifndef _BLK_BSG_ | ||
24 | #define _BLK_BSG_ | ||
25 | |||
26 | #include <linux/blkdev.h> | ||
27 | |||
28 | struct request; | ||
29 | struct device; | ||
30 | struct scatterlist; | ||
31 | struct request_queue; | ||
32 | |||
33 | struct bsg_buffer { | ||
34 | unsigned int payload_len; | ||
35 | int sg_cnt; | ||
36 | struct scatterlist *sg_list; | ||
37 | }; | ||
38 | |||
39 | struct bsg_job { | ||
40 | struct device *dev; | ||
41 | struct request *req; | ||
42 | |||
43 | /* Transport/driver specific request/reply structs */ | ||
44 | void *request; | ||
45 | void *reply; | ||
46 | |||
47 | unsigned int request_len; | ||
48 | unsigned int reply_len; | ||
49 | /* | ||
50 | * On entry : reply_len indicates the buffer size allocated for | ||
51 | * the reply. | ||
52 | * | ||
53 | * Upon completion : the message handler must set reply_len | ||
54 | * to indicates the size of the reply to be returned to the | ||
55 | * caller. | ||
56 | */ | ||
57 | |||
58 | /* DMA payloads for the request/response */ | ||
59 | struct bsg_buffer request_payload; | ||
60 | struct bsg_buffer reply_payload; | ||
61 | |||
62 | void *dd_data; /* Used for driver-specific storage */ | ||
63 | }; | ||
64 | |||
65 | void bsg_job_done(struct bsg_job *job, int result, | ||
66 | unsigned int reply_payload_rcv_len); | ||
67 | int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name, | ||
68 | bsg_job_fn *job_fn, int dd_job_size); | ||
69 | void bsg_request_fn(struct request_queue *q); | ||
70 | void bsg_remove_queue(struct request_queue *q); | ||
71 | void bsg_goose_queue(struct request_queue *q); | ||
72 | |||
73 | #endif | ||
diff --git a/include/linux/loop.h b/include/linux/loop.h index 66c194e2d9b..683d6989011 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -64,7 +64,6 @@ struct loop_device { | |||
64 | 64 | ||
65 | struct request_queue *lo_queue; | 65 | struct request_queue *lo_queue; |
66 | struct gendisk *lo_disk; | 66 | struct gendisk *lo_disk; |
67 | struct list_head lo_list; | ||
68 | }; | 67 | }; |
69 | 68 | ||
70 | #endif /* __KERNEL__ */ | 69 | #endif /* __KERNEL__ */ |
@@ -161,4 +160,8 @@ int loop_unregister_transfer(int number); | |||
161 | #define LOOP_CHANGE_FD 0x4C06 | 160 | #define LOOP_CHANGE_FD 0x4C06 |
162 | #define LOOP_SET_CAPACITY 0x4C07 | 161 | #define LOOP_SET_CAPACITY 0x4C07 |
163 | 162 | ||
163 | /* /dev/loop-control interface */ | ||
164 | #define LOOP_CTL_ADD 0x4C80 | ||
165 | #define LOOP_CTL_REMOVE 0x4C81 | ||
166 | #define LOOP_CTL_GET_FREE 0x4C82 | ||
164 | #endif | 167 | #endif |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 18fd13028ba..c309b1ecdc1 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define BTRFS_MINOR 234 | 40 | #define BTRFS_MINOR 234 |
41 | #define AUTOFS_MINOR 235 | 41 | #define AUTOFS_MINOR 235 |
42 | #define MAPPER_CTRL_MINOR 236 | 42 | #define MAPPER_CTRL_MINOR 236 |
43 | #define LOOP_CTRL_MINOR 237 | ||
43 | #define MISC_DYNAMIC_MINOR 255 | 44 | #define MISC_DYNAMIC_MINOR 255 |
44 | 45 | ||
45 | struct device; | 46 | struct device; |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index bf366547da2..05c5e61f0a7 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
10 | 10 | ||
11 | #define RWBS_LEN 8 | ||
12 | |||
11 | DECLARE_EVENT_CLASS(block_rq_with_error, | 13 | DECLARE_EVENT_CLASS(block_rq_with_error, |
12 | 14 | ||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | 15 | TP_PROTO(struct request_queue *q, struct request *rq), |
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
19 | __field( sector_t, sector ) | 21 | __field( sector_t, sector ) |
20 | __field( unsigned int, nr_sector ) | 22 | __field( unsigned int, nr_sector ) |
21 | __field( int, errors ) | 23 | __field( int, errors ) |
22 | __array( char, rwbs, 6 ) | 24 | __array( char, rwbs, RWBS_LEN ) |
23 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | 25 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
24 | ), | 26 | ), |
25 | 27 | ||
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq, | |||
104 | __field( sector_t, sector ) | 106 | __field( sector_t, sector ) |
105 | __field( unsigned int, nr_sector ) | 107 | __field( unsigned int, nr_sector ) |
106 | __field( unsigned int, bytes ) | 108 | __field( unsigned int, bytes ) |
107 | __array( char, rwbs, 6 ) | 109 | __array( char, rwbs, RWBS_LEN ) |
108 | __array( char, comm, TASK_COMM_LEN ) | 110 | __array( char, comm, TASK_COMM_LEN ) |
109 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | 111 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
110 | ), | 112 | ), |
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce, | |||
183 | __field( dev_t, dev ) | 185 | __field( dev_t, dev ) |
184 | __field( sector_t, sector ) | 186 | __field( sector_t, sector ) |
185 | __field( unsigned int, nr_sector ) | 187 | __field( unsigned int, nr_sector ) |
186 | __array( char, rwbs, 6 ) | 188 | __array( char, rwbs, RWBS_LEN ) |
187 | __array( char, comm, TASK_COMM_LEN ) | 189 | __array( char, comm, TASK_COMM_LEN ) |
188 | ), | 190 | ), |
189 | 191 | ||
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete, | |||
222 | __field( sector_t, sector ) | 224 | __field( sector_t, sector ) |
223 | __field( unsigned, nr_sector ) | 225 | __field( unsigned, nr_sector ) |
224 | __field( int, error ) | 226 | __field( int, error ) |
225 | __array( char, rwbs, 6 ) | 227 | __array( char, rwbs, RWBS_LEN) |
226 | ), | 228 | ), |
227 | 229 | ||
228 | TP_fast_assign( | 230 | TP_fast_assign( |
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio, | |||
249 | __field( dev_t, dev ) | 251 | __field( dev_t, dev ) |
250 | __field( sector_t, sector ) | 252 | __field( sector_t, sector ) |
251 | __field( unsigned int, nr_sector ) | 253 | __field( unsigned int, nr_sector ) |
252 | __array( char, rwbs, 6 ) | 254 | __array( char, rwbs, RWBS_LEN ) |
253 | __array( char, comm, TASK_COMM_LEN ) | 255 | __array( char, comm, TASK_COMM_LEN ) |
254 | ), | 256 | ), |
255 | 257 | ||
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq, | |||
321 | __field( dev_t, dev ) | 323 | __field( dev_t, dev ) |
322 | __field( sector_t, sector ) | 324 | __field( sector_t, sector ) |
323 | __field( unsigned int, nr_sector ) | 325 | __field( unsigned int, nr_sector ) |
324 | __array( char, rwbs, 6 ) | 326 | __array( char, rwbs, RWBS_LEN ) |
325 | __array( char, comm, TASK_COMM_LEN ) | 327 | __array( char, comm, TASK_COMM_LEN ) |
326 | ), | 328 | ), |
327 | 329 | ||
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split, | |||
456 | __field( dev_t, dev ) | 458 | __field( dev_t, dev ) |
457 | __field( sector_t, sector ) | 459 | __field( sector_t, sector ) |
458 | __field( sector_t, new_sector ) | 460 | __field( sector_t, new_sector ) |
459 | __array( char, rwbs, 6 ) | 461 | __array( char, rwbs, RWBS_LEN ) |
460 | __array( char, comm, TASK_COMM_LEN ) | 462 | __array( char, comm, TASK_COMM_LEN ) |
461 | ), | 463 | ), |
462 | 464 | ||
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap, | |||
498 | __field( unsigned int, nr_sector ) | 500 | __field( unsigned int, nr_sector ) |
499 | __field( dev_t, old_dev ) | 501 | __field( dev_t, old_dev ) |
500 | __field( sector_t, old_sector ) | 502 | __field( sector_t, old_sector ) |
501 | __array( char, rwbs, 6 ) | 503 | __array( char, rwbs, RWBS_LEN) |
502 | ), | 504 | ), |
503 | 505 | ||
504 | TP_fast_assign( | 506 | TP_fast_assign( |
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap, | |||
542 | __field( unsigned int, nr_sector ) | 544 | __field( unsigned int, nr_sector ) |
543 | __field( dev_t, old_dev ) | 545 | __field( dev_t, old_dev ) |
544 | __field( sector_t, old_sector ) | 546 | __field( sector_t, old_sector ) |
545 | __array( char, rwbs, 6 ) | 547 | __array( char, rwbs, RWBS_LEN) |
546 | ), | 548 | ), |
547 | 549 | ||
548 | TP_fast_assign( | 550 | TP_fast_assign( |