diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-17 12:29:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-17 12:29:55 -0400 |
commit | c53dbf54863e7f3b0b8810dda2bdd0290006bdac (patch) | |
tree | f783074f1bec1112bf1148a077e0114a38403ad4 /include | |
parent | b73b636e8987f8728c6c700377615757691b9a55 (diff) | |
parent | f73e2d13a16cc88c4faa4729967f92bfeec8a142 (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: remove __generic_unplug_device() from exports
block: move q->unplug_work initialization
blktrace: pass zfcp driver data
blktrace: add support for driver data
block: fix current kernel-doc warnings
block: only call ->request_fn when the queue is not stopped
block: simplify string handling in elv_iosched_store()
block: fix kernel-doc for blk_alloc_devt()
block: fix nr_phys_segments miscalculation bug
block: add partition attribute for partition number
block: add BIG FAT WARNING to CONFIG_DEBUG_BLOCK_EXT_DEVT
softirq: Add support for triggering softirq work on softirqs.
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bio.h | 7 | ||||
-rw-r--r-- | include/linux/blkdev.h | 1 | ||||
-rw-r--r-- | include/linux/blktrace_api.h | 32 | ||||
-rw-r--r-- | include/linux/interrupt.h | 21 | ||||
-rw-r--r-- | include/linux/smp.h | 4 |
5 files changed, 63 insertions, 2 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 1beda208cbfb..1c91a176b9ae 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -79,6 +79,13 @@ struct bio { | |||
79 | 79 | ||
80 | unsigned int bi_size; /* residual I/O count */ | 80 | unsigned int bi_size; /* residual I/O count */ |
81 | 81 | ||
82 | /* | ||
83 | * To keep track of the max segment size, we account for the | ||
84 | * sizes of the first and last mergeable segments in this bio. | ||
85 | */ | ||
86 | unsigned int bi_seg_front_size; | ||
87 | unsigned int bi_seg_back_size; | ||
88 | |||
82 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ | 89 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ |
83 | 90 | ||
84 | unsigned int bi_comp_cpu; /* completion CPU */ | 91 | unsigned int bi_comp_cpu; /* completion CPU */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f3491d225268..b4fe68fe3a57 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -865,7 +865,6 @@ extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); | |||
865 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 865 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
866 | extern void blk_dump_rq_flags(struct request *, char *); | 866 | extern void blk_dump_rq_flags(struct request *, char *); |
867 | extern void generic_unplug_device(struct request_queue *); | 867 | extern void generic_unplug_device(struct request_queue *); |
868 | extern void __generic_unplug_device(struct request_queue *); | ||
869 | extern long nr_blockdev_pages(void); | 868 | extern long nr_blockdev_pages(void); |
870 | 869 | ||
871 | int blk_get_queue(struct request_queue *); | 870 | int blk_get_queue(struct request_queue *); |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 3a31eb506164..bdf505d33e77 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -24,6 +24,7 @@ enum blktrace_cat { | |||
24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
25 | BLK_TC_META = 1 << 12, /* metadata */ | 25 | BLK_TC_META = 1 << 12, /* metadata */ |
26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | 26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ |
27 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ | ||
27 | 28 | ||
28 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 29 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
29 | }; | 30 | }; |
@@ -51,6 +52,7 @@ enum blktrace_act { | |||
51 | __BLK_TA_BOUNCE, /* bio was bounced */ | 52 | __BLK_TA_BOUNCE, /* bio was bounced */ |
52 | __BLK_TA_REMAP, /* bio was remapped */ | 53 | __BLK_TA_REMAP, /* bio was remapped */ |
53 | __BLK_TA_ABORT, /* request aborted */ | 54 | __BLK_TA_ABORT, /* request aborted */ |
55 | __BLK_TA_DRV_DATA, /* driver-specific binary data */ | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | /* | 58 | /* |
@@ -82,6 +84,7 @@ enum blktrace_notify { | |||
82 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | 84 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
83 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | 85 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
84 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) | 86 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) |
87 | #define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA)) | ||
85 | 88 | ||
86 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | 89 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
87 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | 90 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
@@ -317,6 +320,34 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
317 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | 320 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
318 | } | 321 | } |
319 | 322 | ||
323 | /** | ||
324 | * blk_add_driver_data - Add binary message with driver-specific data | ||
325 | * @q: queue the io is for | ||
326 | * @rq: io request | ||
327 | * @data: driver-specific data | ||
328 | * @len: length of driver-specific data | ||
329 | * | ||
330 | * Description: | ||
331 | * Some drivers might want to write driver-specific data per request. | ||
332 | * | ||
333 | **/ | ||
334 | static inline void blk_add_driver_data(struct request_queue *q, | ||
335 | struct request *rq, | ||
336 | void *data, size_t len) | ||
337 | { | ||
338 | struct blk_trace *bt = q->blk_trace; | ||
339 | |||
340 | if (likely(!bt)) | ||
341 | return; | ||
342 | |||
343 | if (blk_pc_request(rq)) | ||
344 | __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA, | ||
345 | rq->errors, len, data); | ||
346 | else | ||
347 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | ||
348 | 0, BLK_TA_DRV_DATA, rq->errors, len, data); | ||
349 | } | ||
350 | |||
320 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | 351 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
321 | char __user *arg); | 352 | char __user *arg); |
322 | extern int blk_trace_startstop(struct request_queue *q, int start); | 353 | extern int blk_trace_startstop(struct request_queue *q, int start); |
@@ -330,6 +361,7 @@ extern int blk_trace_remove(struct request_queue *q); | |||
330 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | 361 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) |
331 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | 362 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) |
332 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | 363 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) |
364 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | ||
333 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) | 365 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) |
334 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 366 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) |
335 | #define blk_trace_startstop(q, start) (-ENOTTY) | 367 | #define blk_trace_startstop(q, start) (-ENOTTY) |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 54b3623434ec..35a61dc60d51 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/irqflags.h> | 13 | #include <linux/irqflags.h> |
14 | #include <linux/smp.h> | ||
15 | #include <linux/percpu.h> | ||
14 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
15 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
16 | #include <asm/system.h> | 18 | #include <asm/system.h> |
@@ -273,6 +275,25 @@ extern void softirq_init(void); | |||
273 | extern void raise_softirq_irqoff(unsigned int nr); | 275 | extern void raise_softirq_irqoff(unsigned int nr); |
274 | extern void raise_softirq(unsigned int nr); | 276 | extern void raise_softirq(unsigned int nr); |
275 | 277 | ||
278 | /* This is the worklist that queues up per-cpu softirq work. | ||
279 | * | ||
280 | * send_remote_sendirq() adds work to these lists, and | ||
281 | * the softirq handler itself dequeues from them. The queues | ||
282 | * are protected by disabling local cpu interrupts and they must | ||
283 | * only be accessed by the local cpu that they are for. | ||
284 | */ | ||
285 | DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); | ||
286 | |||
287 | /* Try to send a softirq to a remote cpu. If this cannot be done, the | ||
288 | * work will be queued to the local cpu. | ||
289 | */ | ||
290 | extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq); | ||
291 | |||
292 | /* Like send_remote_softirq(), but the caller must disable local cpu interrupts | ||
293 | * and compute the current cpu, passed in as 'this_cpu'. | ||
294 | */ | ||
295 | extern void __send_remote_softirq(struct call_single_data *cp, int cpu, | ||
296 | int this_cpu, int softirq); | ||
276 | 297 | ||
277 | /* Tasklets --- multithreaded analogue of BHs. | 298 | /* Tasklets --- multithreaded analogue of BHs. |
278 | 299 | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 66484d4a8459..2e4d58b26c06 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/types.h> | ||
10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
11 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
12 | 13 | ||
@@ -16,7 +17,8 @@ struct call_single_data { | |||
16 | struct list_head list; | 17 | struct list_head list; |
17 | void (*func) (void *info); | 18 | void (*func) (void *info); |
18 | void *info; | 19 | void *info; |
19 | unsigned int flags; | 20 | u16 flags; |
21 | u16 priv; | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | #ifdef CONFIG_SMP | 24 | #ifdef CONFIG_SMP |