diff options
-rw-r--r-- | Documentation/DocBook/kernel-api.tmpl | 2 | ||||
-rw-r--r-- | block/blk-barrier.c | 9 | ||||
-rw-r--r-- | block/blk-core.c | 7 | ||||
-rw-r--r-- | block/blk-map.c | 27 | ||||
-rw-r--r-- | block/blk-merge.c | 2 | ||||
-rw-r--r-- | block/blk-settings.c | 22 | ||||
-rw-r--r-- | block/blk-tag.c | 2 | ||||
-rw-r--r-- | block/blk.h | 2 | ||||
-rw-r--r-- | block/bsg.c | 8 | ||||
-rw-r--r-- | block/genhd.c | 10 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 4 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 9 | ||||
-rw-r--r-- | drivers/block/cciss.c | 256 | ||||
-rw-r--r-- | drivers/block/cciss_scsi.c | 10 | ||||
-rw-r--r-- | drivers/cdrom/cdrom.c | 4 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 3 | ||||
-rw-r--r-- | fs/splice.c | 12 | ||||
-rw-r--r-- | include/linux/blkdev.h | 4 | ||||
-rw-r--r-- | include/linux/genhd.h | 5 |
19 files changed, 245 insertions, 153 deletions
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index f31601e8bd89..dc0f30c3e571 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -361,12 +361,14 @@ X!Edrivers/pnp/system.c | |||
361 | <chapter id="blkdev"> | 361 | <chapter id="blkdev"> |
362 | <title>Block Devices</title> | 362 | <title>Block Devices</title> |
363 | !Eblock/blk-core.c | 363 | !Eblock/blk-core.c |
364 | !Iblock/blk-core.c | ||
364 | !Eblock/blk-map.c | 365 | !Eblock/blk-map.c |
365 | !Iblock/blk-sysfs.c | 366 | !Iblock/blk-sysfs.c |
366 | !Eblock/blk-settings.c | 367 | !Eblock/blk-settings.c |
367 | !Eblock/blk-exec.c | 368 | !Eblock/blk-exec.c |
368 | !Eblock/blk-barrier.c | 369 | !Eblock/blk-barrier.c |
369 | !Eblock/blk-tag.c | 370 | !Eblock/blk-tag.c |
371 | !Iblock/blk-tag.c | ||
370 | </chapter> | 372 | </chapter> |
371 | 373 | ||
372 | <chapter id="chrdev"> | 374 | <chapter id="chrdev"> |
diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 6901eedeffce..55c5f1fc4f1f 100644 --- a/block/blk-barrier.c +++ b/block/blk-barrier.c | |||
@@ -259,8 +259,11 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp) | |||
259 | 259 | ||
260 | static void bio_end_empty_barrier(struct bio *bio, int err) | 260 | static void bio_end_empty_barrier(struct bio *bio, int err) |
261 | { | 261 | { |
262 | if (err) | 262 | if (err) { |
263 | if (err == -EOPNOTSUPP) | ||
264 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
263 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | 265 | clear_bit(BIO_UPTODATE, &bio->bi_flags); |
266 | } | ||
264 | 267 | ||
265 | complete(bio->bi_private); | 268 | complete(bio->bi_private); |
266 | } | 269 | } |
@@ -309,7 +312,9 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector) | |||
309 | *error_sector = bio->bi_sector; | 312 | *error_sector = bio->bi_sector; |
310 | 313 | ||
311 | ret = 0; | 314 | ret = 0; |
312 | if (!bio_flagged(bio, BIO_UPTODATE)) | 315 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) |
316 | ret = -EOPNOTSUPP; | ||
317 | else if (!bio_flagged(bio, BIO_UPTODATE)) | ||
313 | ret = -EIO; | 318 | ret = -EIO; |
314 | 319 | ||
315 | bio_put(bio); | 320 | bio_put(bio); |
diff --git a/block/blk-core.c b/block/blk-core.c index 775c8516abf5..2a438a93f723 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -127,7 +127,6 @@ void rq_init(struct request_queue *q, struct request *rq) | |||
127 | rq->nr_hw_segments = 0; | 127 | rq->nr_hw_segments = 0; |
128 | rq->ioprio = 0; | 128 | rq->ioprio = 0; |
129 | rq->special = NULL; | 129 | rq->special = NULL; |
130 | rq->raw_data_len = 0; | ||
131 | rq->buffer = NULL; | 130 | rq->buffer = NULL; |
132 | rq->tag = -1; | 131 | rq->tag = -1; |
133 | rq->errors = 0; | 132 | rq->errors = 0; |
@@ -135,6 +134,7 @@ void rq_init(struct request_queue *q, struct request *rq) | |||
135 | rq->cmd_len = 0; | 134 | rq->cmd_len = 0; |
136 | memset(rq->cmd, 0, sizeof(rq->cmd)); | 135 | memset(rq->cmd, 0, sizeof(rq->cmd)); |
137 | rq->data_len = 0; | 136 | rq->data_len = 0; |
137 | rq->extra_len = 0; | ||
138 | rq->sense_len = 0; | 138 | rq->sense_len = 0; |
139 | rq->data = NULL; | 139 | rq->data = NULL; |
140 | rq->sense = NULL; | 140 | rq->sense = NULL; |
@@ -424,7 +424,6 @@ void blk_put_queue(struct request_queue *q) | |||
424 | { | 424 | { |
425 | kobject_put(&q->kobj); | 425 | kobject_put(&q->kobj); |
426 | } | 426 | } |
427 | EXPORT_SYMBOL(blk_put_queue); | ||
428 | 427 | ||
429 | void blk_cleanup_queue(struct request_queue *q) | 428 | void blk_cleanup_queue(struct request_queue *q) |
430 | { | 429 | { |
@@ -592,7 +591,6 @@ int blk_get_queue(struct request_queue *q) | |||
592 | 591 | ||
593 | return 1; | 592 | return 1; |
594 | } | 593 | } |
595 | EXPORT_SYMBOL(blk_get_queue); | ||
596 | 594 | ||
597 | static inline void blk_free_request(struct request_queue *q, struct request *rq) | 595 | static inline void blk_free_request(struct request_queue *q, struct request *rq) |
598 | { | 596 | { |
@@ -1768,6 +1766,7 @@ static inline void __end_request(struct request *rq, int uptodate, | |||
1768 | 1766 | ||
1769 | /** | 1767 | /** |
1770 | * blk_rq_bytes - Returns bytes left to complete in the entire request | 1768 | * blk_rq_bytes - Returns bytes left to complete in the entire request |
1769 | * @rq: the request being processed | ||
1771 | **/ | 1770 | **/ |
1772 | unsigned int blk_rq_bytes(struct request *rq) | 1771 | unsigned int blk_rq_bytes(struct request *rq) |
1773 | { | 1772 | { |
@@ -1780,6 +1779,7 @@ EXPORT_SYMBOL_GPL(blk_rq_bytes); | |||
1780 | 1779 | ||
1781 | /** | 1780 | /** |
1782 | * blk_rq_cur_bytes - Returns bytes left to complete in the current segment | 1781 | * blk_rq_cur_bytes - Returns bytes left to complete in the current segment |
1782 | * @rq: the request being processed | ||
1783 | **/ | 1783 | **/ |
1784 | unsigned int blk_rq_cur_bytes(struct request *rq) | 1784 | unsigned int blk_rq_cur_bytes(struct request *rq) |
1785 | { | 1785 | { |
@@ -2016,7 +2016,6 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | |||
2016 | rq->hard_cur_sectors = rq->current_nr_sectors; | 2016 | rq->hard_cur_sectors = rq->current_nr_sectors; |
2017 | rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio); | 2017 | rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio); |
2018 | rq->buffer = bio_data(bio); | 2018 | rq->buffer = bio_data(bio); |
2019 | rq->raw_data_len = bio->bi_size; | ||
2020 | rq->data_len = bio->bi_size; | 2019 | rq->data_len = bio->bi_size; |
2021 | 2020 | ||
2022 | rq->bio = rq->biotail = bio; | 2021 | rq->bio = rq->biotail = bio; |
diff --git a/block/blk-map.c b/block/blk-map.c index 09f7fd0bcb73..c07d9c8317f4 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -19,7 +19,6 @@ int blk_rq_append_bio(struct request_queue *q, struct request *rq, | |||
19 | rq->biotail->bi_next = bio; | 19 | rq->biotail->bi_next = bio; |
20 | rq->biotail = bio; | 20 | rq->biotail = bio; |
21 | 21 | ||
22 | rq->raw_data_len += bio->bi_size; | ||
23 | rq->data_len += bio->bi_size; | 22 | rq->data_len += bio->bi_size; |
24 | } | 23 | } |
25 | return 0; | 24 | return 0; |
@@ -44,6 +43,7 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq, | |||
44 | void __user *ubuf, unsigned int len) | 43 | void __user *ubuf, unsigned int len) |
45 | { | 44 | { |
46 | unsigned long uaddr; | 45 | unsigned long uaddr; |
46 | unsigned int alignment; | ||
47 | struct bio *bio, *orig_bio; | 47 | struct bio *bio, *orig_bio; |
48 | int reading, ret; | 48 | int reading, ret; |
49 | 49 | ||
@@ -54,8 +54,8 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq, | |||
54 | * direct dma. else, set up kernel bounce buffers | 54 | * direct dma. else, set up kernel bounce buffers |
55 | */ | 55 | */ |
56 | uaddr = (unsigned long) ubuf; | 56 | uaddr = (unsigned long) ubuf; |
57 | if (!(uaddr & queue_dma_alignment(q)) && | 57 | alignment = queue_dma_alignment(q) | q->dma_pad_mask; |
58 | !(len & queue_dma_alignment(q))) | 58 | if (!(uaddr & alignment) && !(len & alignment)) |
59 | bio = bio_map_user(q, NULL, uaddr, len, reading); | 59 | bio = bio_map_user(q, NULL, uaddr, len, reading); |
60 | else | 60 | else |
61 | bio = bio_copy_user(q, uaddr, len, reading); | 61 | bio = bio_copy_user(q, uaddr, len, reading); |
@@ -142,20 +142,22 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq, | |||
142 | 142 | ||
143 | /* | 143 | /* |
144 | * __blk_rq_map_user() copies the buffers if starting address | 144 | * __blk_rq_map_user() copies the buffers if starting address |
145 | * or length isn't aligned. As the copied buffer is always | 145 | * or length isn't aligned to dma_pad_mask. As the copied |
146 | * page aligned, we know that there's enough room for padding. | 146 | * buffer is always page aligned, we know that there's enough |
147 | * Extend the last bio and update rq->data_len accordingly. | 147 | * room for padding. Extend the last bio and update |
148 | * rq->data_len accordingly. | ||
148 | * | 149 | * |
149 | * On unmap, bio_uncopy_user() will use unmodified | 150 | * On unmap, bio_uncopy_user() will use unmodified |
150 | * bio_map_data pointed to by bio->bi_private. | 151 | * bio_map_data pointed to by bio->bi_private. |
151 | */ | 152 | */ |
152 | if (len & queue_dma_alignment(q)) { | 153 | if (len & q->dma_pad_mask) { |
153 | unsigned int pad_len = (queue_dma_alignment(q) & ~len) + 1; | 154 | unsigned int pad_len = (q->dma_pad_mask & ~len) + 1; |
154 | struct bio *bio = rq->biotail; | 155 | struct bio *tail = rq->biotail; |
155 | 156 | ||
156 | bio->bi_io_vec[bio->bi_vcnt - 1].bv_len += pad_len; | 157 | tail->bi_io_vec[tail->bi_vcnt - 1].bv_len += pad_len; |
157 | bio->bi_size += pad_len; | 158 | tail->bi_size += pad_len; |
158 | rq->data_len += pad_len; | 159 | |
160 | rq->extra_len += pad_len; | ||
159 | } | 161 | } |
160 | 162 | ||
161 | rq->buffer = rq->data = NULL; | 163 | rq->buffer = rq->data = NULL; |
@@ -215,7 +217,6 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
215 | rq->buffer = rq->data = NULL; | 217 | rq->buffer = rq->data = NULL; |
216 | return 0; | 218 | return 0; |
217 | } | 219 | } |
218 | EXPORT_SYMBOL(blk_rq_map_user_iov); | ||
219 | 220 | ||
220 | /** | 221 | /** |
221 | * blk_rq_unmap_user - unmap a request with user data | 222 | * blk_rq_unmap_user - unmap a request with user data |
diff --git a/block/blk-merge.c b/block/blk-merge.c index 7506c4fe0264..0f58616bcd7f 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -231,7 +231,7 @@ new_segment: | |||
231 | ((unsigned long)q->dma_drain_buffer) & | 231 | ((unsigned long)q->dma_drain_buffer) & |
232 | (PAGE_SIZE - 1)); | 232 | (PAGE_SIZE - 1)); |
233 | nsegs++; | 233 | nsegs++; |
234 | rq->data_len += q->dma_drain_size; | 234 | rq->extra_len += q->dma_drain_size; |
235 | } | 235 | } |
236 | 236 | ||
237 | if (sg) | 237 | if (sg) |
diff --git a/block/blk-settings.c b/block/blk-settings.c index 9a8ffdd0ce3d..1344a0ea5cc6 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -140,7 +140,7 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_addr) | |||
140 | /* Assume anything <= 4GB can be handled by IOMMU. | 140 | /* Assume anything <= 4GB can be handled by IOMMU. |
141 | Actually some IOMMUs can handle everything, but I don't | 141 | Actually some IOMMUs can handle everything, but I don't |
142 | know of a way to test this here. */ | 142 | know of a way to test this here. */ |
143 | if (b_pfn < (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) | 143 | if (b_pfn <= (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) |
144 | dma = 1; | 144 | dma = 1; |
145 | q->bounce_pfn = max_low_pfn; | 145 | q->bounce_pfn = max_low_pfn; |
146 | #else | 146 | #else |
@@ -293,8 +293,24 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b) | |||
293 | EXPORT_SYMBOL(blk_queue_stack_limits); | 293 | EXPORT_SYMBOL(blk_queue_stack_limits); |
294 | 294 | ||
295 | /** | 295 | /** |
296 | * blk_queue_dma_drain - Set up a drain buffer for excess dma. | 296 | * blk_queue_dma_pad - set pad mask |
297 | * @q: the request queue for the device | ||
298 | * @mask: pad mask | ||
299 | * | ||
300 | * Set pad mask. Direct IO requests are padded to the mask specified. | ||
297 | * | 301 | * |
302 | * Appending pad buffer to a request modifies ->data_len such that it | ||
303 | * includes the pad buffer. The original requested data length can be | ||
304 | * obtained using blk_rq_raw_data_len(). | ||
305 | **/ | ||
306 | void blk_queue_dma_pad(struct request_queue *q, unsigned int mask) | ||
307 | { | ||
308 | q->dma_pad_mask = mask; | ||
309 | } | ||
310 | EXPORT_SYMBOL(blk_queue_dma_pad); | ||
311 | |||
312 | /** | ||
313 | * blk_queue_dma_drain - Set up a drain buffer for excess dma. | ||
298 | * @q: the request queue for the device | 314 | * @q: the request queue for the device |
299 | * @dma_drain_needed: fn which returns non-zero if drain is necessary | 315 | * @dma_drain_needed: fn which returns non-zero if drain is necessary |
300 | * @buf: physically contiguous buffer | 316 | * @buf: physically contiguous buffer |
@@ -316,7 +332,7 @@ EXPORT_SYMBOL(blk_queue_stack_limits); | |||
316 | * device can support otherwise there won't be room for the drain | 332 | * device can support otherwise there won't be room for the drain |
317 | * buffer. | 333 | * buffer. |
318 | */ | 334 | */ |
319 | extern int blk_queue_dma_drain(struct request_queue *q, | 335 | int blk_queue_dma_drain(struct request_queue *q, |
320 | dma_drain_needed_fn *dma_drain_needed, | 336 | dma_drain_needed_fn *dma_drain_needed, |
321 | void *buf, unsigned int size) | 337 | void *buf, unsigned int size) |
322 | { | 338 | { |
diff --git a/block/blk-tag.c b/block/blk-tag.c index a8c37d4bbb32..4780a46ce234 100644 --- a/block/blk-tag.c +++ b/block/blk-tag.c | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <linux/bio.h> | 6 | #include <linux/bio.h> |
7 | #include <linux/blkdev.h> | 7 | #include <linux/blkdev.h> |
8 | 8 | ||
9 | #include "blk.h" | ||
10 | |||
9 | /** | 11 | /** |
10 | * blk_queue_find_tag - find a request by its tag and queue | 12 | * blk_queue_find_tag - find a request by its tag and queue |
11 | * @q: The request queue for the device | 13 | * @q: The request queue for the device |
diff --git a/block/blk.h b/block/blk.h index ec898dd0c65c..ec9120fb789a 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -32,6 +32,8 @@ void blk_recalc_rq_sectors(struct request *rq, int nsect); | |||
32 | 32 | ||
33 | void blk_queue_congestion_threshold(struct request_queue *q); | 33 | void blk_queue_congestion_threshold(struct request_queue *q); |
34 | 34 | ||
35 | int blk_dev_init(void); | ||
36 | |||
35 | /* | 37 | /* |
36 | * Return the threshold (number of used requests) at which the queue is | 38 | * Return the threshold (number of used requests) at which the queue is |
37 | * considered to be congested. It include a little hysteresis to keep the | 39 | * considered to be congested. It include a little hysteresis to keep the |
diff --git a/block/bsg.c b/block/bsg.c index 7f3c09549e4b..8917c5174dc2 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -437,14 +437,14 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, | |||
437 | } | 437 | } |
438 | 438 | ||
439 | if (rq->next_rq) { | 439 | if (rq->next_rq) { |
440 | hdr->dout_resid = rq->raw_data_len; | 440 | hdr->dout_resid = rq->data_len; |
441 | hdr->din_resid = rq->next_rq->raw_data_len; | 441 | hdr->din_resid = rq->next_rq->data_len; |
442 | blk_rq_unmap_user(bidi_bio); | 442 | blk_rq_unmap_user(bidi_bio); |
443 | blk_put_request(rq->next_rq); | 443 | blk_put_request(rq->next_rq); |
444 | } else if (rq_data_dir(rq) == READ) | 444 | } else if (rq_data_dir(rq) == READ) |
445 | hdr->din_resid = rq->raw_data_len; | 445 | hdr->din_resid = rq->data_len; |
446 | else | 446 | else |
447 | hdr->dout_resid = rq->raw_data_len; | 447 | hdr->dout_resid = rq->data_len; |
448 | 448 | ||
449 | /* | 449 | /* |
450 | * If the request generated a negative error number, return it | 450 | * If the request generated a negative error number, return it |
diff --git a/block/genhd.c b/block/genhd.c index 53f2238e69c8..c44527d16c52 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -17,11 +17,15 @@ | |||
17 | #include <linux/buffer_head.h> | 17 | #include <linux/buffer_head.h> |
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | 19 | ||
20 | #include "blk.h" | ||
21 | |||
20 | static DEFINE_MUTEX(block_class_lock); | 22 | static DEFINE_MUTEX(block_class_lock); |
21 | #ifndef CONFIG_SYSFS_DEPRECATED | 23 | #ifndef CONFIG_SYSFS_DEPRECATED |
22 | struct kobject *block_depr; | 24 | struct kobject *block_depr; |
23 | #endif | 25 | #endif |
24 | 26 | ||
27 | static struct device_type disk_type; | ||
28 | |||
25 | /* | 29 | /* |
26 | * Can be deleted altogether. Later. | 30 | * Can be deleted altogether. Later. |
27 | * | 31 | * |
@@ -346,8 +350,6 @@ const struct seq_operations partitions_op = { | |||
346 | #endif | 350 | #endif |
347 | 351 | ||
348 | 352 | ||
349 | extern int blk_dev_init(void); | ||
350 | |||
351 | static struct kobject *base_probe(dev_t devt, int *part, void *data) | 353 | static struct kobject *base_probe(dev_t devt, int *part, void *data) |
352 | { | 354 | { |
353 | if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0) | 355 | if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0) |
@@ -502,7 +504,7 @@ struct class block_class = { | |||
502 | .name = "block", | 504 | .name = "block", |
503 | }; | 505 | }; |
504 | 506 | ||
505 | struct device_type disk_type = { | 507 | static struct device_type disk_type = { |
506 | .name = "disk", | 508 | .name = "disk", |
507 | .groups = disk_attr_groups, | 509 | .groups = disk_attr_groups, |
508 | .release = disk_release, | 510 | .release = disk_release, |
@@ -632,12 +634,14 @@ static void media_change_notify_thread(struct work_struct *work) | |||
632 | put_device(gd->driverfs_dev); | 634 | put_device(gd->driverfs_dev); |
633 | } | 635 | } |
634 | 636 | ||
637 | #if 0 | ||
635 | void genhd_media_change_notify(struct gendisk *disk) | 638 | void genhd_media_change_notify(struct gendisk *disk) |
636 | { | 639 | { |
637 | get_device(disk->driverfs_dev); | 640 | get_device(disk->driverfs_dev); |
638 | schedule_work(&disk->async_notify); | 641 | schedule_work(&disk->async_notify); |
639 | } | 642 | } |
640 | EXPORT_SYMBOL_GPL(genhd_media_change_notify); | 643 | EXPORT_SYMBOL_GPL(genhd_media_change_notify); |
644 | #endif /* 0 */ | ||
641 | 645 | ||
642 | dev_t blk_lookup_devt(const char *name) | 646 | dev_t blk_lookup_devt(const char *name) |
643 | { | 647 | { |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index e993cac4911d..a2c3a936ebf9 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -266,7 +266,7 @@ static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr, | |||
266 | hdr->info = 0; | 266 | hdr->info = 0; |
267 | if (hdr->masked_status || hdr->host_status || hdr->driver_status) | 267 | if (hdr->masked_status || hdr->host_status || hdr->driver_status) |
268 | hdr->info |= SG_INFO_CHECK; | 268 | hdr->info |= SG_INFO_CHECK; |
269 | hdr->resid = rq->raw_data_len; | 269 | hdr->resid = rq->data_len; |
270 | hdr->sb_len_wr = 0; | 270 | hdr->sb_len_wr = 0; |
271 | 271 | ||
272 | if (rq->sense_len && hdr->sbp) { | 272 | if (rq->sense_len && hdr->sbp) { |
@@ -528,8 +528,8 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk, | |||
528 | rq = blk_get_request(q, WRITE, __GFP_WAIT); | 528 | rq = blk_get_request(q, WRITE, __GFP_WAIT); |
529 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 529 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
530 | rq->data = NULL; | 530 | rq->data = NULL; |
531 | rq->raw_data_len = 0; | ||
532 | rq->data_len = 0; | 531 | rq->data_len = 0; |
532 | rq->extra_len = 0; | ||
533 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; | 533 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; |
534 | memset(rq->cmd, 0, sizeof(rq->cmd)); | 534 | memset(rq->cmd, 0, sizeof(rq->cmd)); |
535 | rq->cmd[0] = cmd; | 535 | rq->cmd[0] = cmd; |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 7b1f1ee8131d..8f0e8f2bc628 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -862,9 +862,10 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, | |||
862 | struct request_queue *q = sdev->request_queue; | 862 | struct request_queue *q = sdev->request_queue; |
863 | void *buf; | 863 | void *buf; |
864 | 864 | ||
865 | /* set the min alignment */ | 865 | /* set the min alignment and padding */ |
866 | blk_queue_update_dma_alignment(sdev->request_queue, | 866 | blk_queue_update_dma_alignment(sdev->request_queue, |
867 | ATA_DMA_PAD_SZ - 1); | 867 | ATA_DMA_PAD_SZ - 1); |
868 | blk_queue_dma_pad(sdev->request_queue, ATA_DMA_PAD_SZ - 1); | ||
868 | 869 | ||
869 | /* configure draining */ | 870 | /* configure draining */ |
870 | buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL); | 871 | buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL); |
@@ -2538,7 +2539,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2538 | } | 2539 | } |
2539 | 2540 | ||
2540 | qc->tf.command = ATA_CMD_PACKET; | 2541 | qc->tf.command = ATA_CMD_PACKET; |
2541 | qc->nbytes = scsi_bufflen(scmd); | 2542 | qc->nbytes = scsi_bufflen(scmd) + scmd->request->extra_len; |
2542 | 2543 | ||
2543 | /* check whether ATAPI DMA is safe */ | 2544 | /* check whether ATAPI DMA is safe */ |
2544 | if (!using_pio && ata_check_atapi_dma(qc)) | 2545 | if (!using_pio && ata_check_atapi_dma(qc)) |
@@ -2549,7 +2550,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2549 | * want to set it properly, and for DMA where it is | 2550 | * want to set it properly, and for DMA where it is |
2550 | * effectively meaningless. | 2551 | * effectively meaningless. |
2551 | */ | 2552 | */ |
2552 | nbytes = min(scmd->request->raw_data_len, (unsigned int)63 * 1024); | 2553 | nbytes = min(scmd->request->data_len, (unsigned int)63 * 1024); |
2553 | 2554 | ||
2554 | /* Most ATAPI devices which honor transfer chunk size don't | 2555 | /* Most ATAPI devices which honor transfer chunk size don't |
2555 | * behave according to the spec when odd chunk size which | 2556 | * behave according to the spec when odd chunk size which |
@@ -2875,7 +2876,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc) | |||
2875 | * TODO: find out if we need to do more here to | 2876 | * TODO: find out if we need to do more here to |
2876 | * cover scatter/gather case. | 2877 | * cover scatter/gather case. |
2877 | */ | 2878 | */ |
2878 | qc->nbytes = scsi_bufflen(scmd); | 2879 | qc->nbytes = scsi_bufflen(scmd) + scmd->request->extra_len; |
2879 | 2880 | ||
2880 | /* request result TF and be quiet about device error */ | 2881 | /* request result TF and be quiet about device error */ |
2881 | qc->flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET; | 2882 | qc->flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET; |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 9715be3f2487..55bd35c0f082 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/blkpg.h> | 33 | #include <linux/blkpg.h> |
34 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
35 | #include <linux/proc_fs.h> | 35 | #include <linux/proc_fs.h> |
36 | #include <linux/seq_file.h> | ||
36 | #include <linux/init.h> | 37 | #include <linux/init.h> |
37 | #include <linux/hdreg.h> | 38 | #include <linux/hdreg.h> |
38 | #include <linux/spinlock.h> | 39 | #include <linux/spinlock.h> |
@@ -131,7 +132,6 @@ static struct board_type products[] = { | |||
131 | /*define how many times we will try a command because of bus resets */ | 132 | /*define how many times we will try a command because of bus resets */ |
132 | #define MAX_CMD_RETRIES 3 | 133 | #define MAX_CMD_RETRIES 3 |
133 | 134 | ||
134 | #define READ_AHEAD 1024 | ||
135 | #define MAX_CTLR 32 | 135 | #define MAX_CTLR 32 |
136 | 136 | ||
137 | /* Originally cciss driver only supports 8 major numbers */ | 137 | /* Originally cciss driver only supports 8 major numbers */ |
@@ -174,8 +174,6 @@ static int sendcmd_withirq(__u8 cmd, int ctlr, void *buff, size_t size, | |||
174 | static void fail_all_cmds(unsigned long ctlr); | 174 | static void fail_all_cmds(unsigned long ctlr); |
175 | 175 | ||
176 | #ifdef CONFIG_PROC_FS | 176 | #ifdef CONFIG_PROC_FS |
177 | static int cciss_proc_get_info(char *buffer, char **start, off_t offset, | ||
178 | int length, int *eof, void *data); | ||
179 | static void cciss_procinit(int i); | 177 | static void cciss_procinit(int i); |
180 | #else | 178 | #else |
181 | static void cciss_procinit(int i) | 179 | static void cciss_procinit(int i) |
@@ -240,24 +238,46 @@ static inline CommandList_struct *removeQ(CommandList_struct **Qptr, | |||
240 | */ | 238 | */ |
241 | #define ENG_GIG 1000000000 | 239 | #define ENG_GIG 1000000000 |
242 | #define ENG_GIG_FACTOR (ENG_GIG/512) | 240 | #define ENG_GIG_FACTOR (ENG_GIG/512) |
241 | #define ENGAGE_SCSI "engage scsi" | ||
243 | static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", | 242 | static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", |
244 | "UNKNOWN" | 243 | "UNKNOWN" |
245 | }; | 244 | }; |
246 | 245 | ||
247 | static struct proc_dir_entry *proc_cciss; | 246 | static struct proc_dir_entry *proc_cciss; |
248 | 247 | ||
249 | static int cciss_proc_get_info(char *buffer, char **start, off_t offset, | 248 | static void cciss_seq_show_header(struct seq_file *seq) |
250 | int length, int *eof, void *data) | ||
251 | { | 249 | { |
252 | off_t pos = 0; | 250 | ctlr_info_t *h = seq->private; |
253 | off_t len = 0; | 251 | |
254 | int size, i, ctlr; | 252 | seq_printf(seq, "%s: HP %s Controller\n" |
255 | ctlr_info_t *h = (ctlr_info_t *) data; | 253 | "Board ID: 0x%08lx\n" |
256 | drive_info_struct *drv; | 254 | "Firmware Version: %c%c%c%c\n" |
257 | unsigned long flags; | 255 | "IRQ: %d\n" |
258 | sector_t vol_sz, vol_sz_frac; | 256 | "Logical drives: %d\n" |
257 | "Current Q depth: %d\n" | ||
258 | "Current # commands on controller: %d\n" | ||
259 | "Max Q depth since init: %d\n" | ||
260 | "Max # commands on controller since init: %d\n" | ||
261 | "Max SG entries since init: %d\n", | ||
262 | h->devname, | ||
263 | h->product_name, | ||
264 | (unsigned long)h->board_id, | ||
265 | h->firm_ver[0], h->firm_ver[1], h->firm_ver[2], | ||
266 | h->firm_ver[3], (unsigned int)h->intr[SIMPLE_MODE_INT], | ||
267 | h->num_luns, | ||
268 | h->Qdepth, h->commands_outstanding, | ||
269 | h->maxQsinceinit, h->max_outstanding, h->maxSG); | ||
259 | 270 | ||
260 | ctlr = h->ctlr; | 271 | #ifdef CONFIG_CISS_SCSI_TAPE |
272 | cciss_seq_tape_report(seq, h->ctlr); | ||
273 | #endif /* CONFIG_CISS_SCSI_TAPE */ | ||
274 | } | ||
275 | |||
276 | static void *cciss_seq_start(struct seq_file *seq, loff_t *pos) | ||
277 | { | ||
278 | ctlr_info_t *h = seq->private; | ||
279 | unsigned ctlr = h->ctlr; | ||
280 | unsigned long flags; | ||
261 | 281 | ||
262 | /* prevent displaying bogus info during configuration | 282 | /* prevent displaying bogus info during configuration |
263 | * or deconfiguration of a logical volume | 283 | * or deconfiguration of a logical volume |
@@ -265,115 +285,155 @@ static int cciss_proc_get_info(char *buffer, char **start, off_t offset, | |||
265 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); | 285 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); |
266 | if (h->busy_configuring) { | 286 | if (h->busy_configuring) { |
267 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); | 287 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); |
268 | return -EBUSY; | 288 | return ERR_PTR(-EBUSY); |
269 | } | 289 | } |
270 | h->busy_configuring = 1; | 290 | h->busy_configuring = 1; |
271 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); | 291 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); |
272 | 292 | ||
273 | size = sprintf(buffer, "%s: HP %s Controller\n" | 293 | if (*pos == 0) |
274 | "Board ID: 0x%08lx\n" | 294 | cciss_seq_show_header(seq); |
275 | "Firmware Version: %c%c%c%c\n" | ||
276 | "IRQ: %d\n" | ||
277 | "Logical drives: %d\n" | ||
278 | "Max sectors: %d\n" | ||
279 | "Current Q depth: %d\n" | ||
280 | "Current # commands on controller: %d\n" | ||
281 | "Max Q depth since init: %d\n" | ||
282 | "Max # commands on controller since init: %d\n" | ||
283 | "Max SG entries since init: %d\n\n", | ||
284 | h->devname, | ||
285 | h->product_name, | ||
286 | (unsigned long)h->board_id, | ||
287 | h->firm_ver[0], h->firm_ver[1], h->firm_ver[2], | ||
288 | h->firm_ver[3], (unsigned int)h->intr[SIMPLE_MODE_INT], | ||
289 | h->num_luns, | ||
290 | h->cciss_max_sectors, | ||
291 | h->Qdepth, h->commands_outstanding, | ||
292 | h->maxQsinceinit, h->max_outstanding, h->maxSG); | ||
293 | |||
294 | pos += size; | ||
295 | len += size; | ||
296 | cciss_proc_tape_report(ctlr, buffer, &pos, &len); | ||
297 | for (i = 0; i <= h->highest_lun; i++) { | ||
298 | |||
299 | drv = &h->drv[i]; | ||
300 | if (drv->heads == 0) | ||
301 | continue; | ||
302 | 295 | ||
303 | vol_sz = drv->nr_blocks; | 296 | return pos; |
304 | vol_sz_frac = sector_div(vol_sz, ENG_GIG_FACTOR); | 297 | } |
305 | vol_sz_frac *= 100; | 298 | |
306 | sector_div(vol_sz_frac, ENG_GIG_FACTOR); | 299 | static int cciss_seq_show(struct seq_file *seq, void *v) |
300 | { | ||
301 | sector_t vol_sz, vol_sz_frac; | ||
302 | ctlr_info_t *h = seq->private; | ||
303 | unsigned ctlr = h->ctlr; | ||
304 | loff_t *pos = v; | ||
305 | drive_info_struct *drv = &h->drv[*pos]; | ||
306 | |||
307 | if (*pos > h->highest_lun) | ||
308 | return 0; | ||
309 | |||
310 | if (drv->heads == 0) | ||
311 | return 0; | ||
312 | |||
313 | vol_sz = drv->nr_blocks; | ||
314 | vol_sz_frac = sector_div(vol_sz, ENG_GIG_FACTOR); | ||
315 | vol_sz_frac *= 100; | ||
316 | sector_div(vol_sz_frac, ENG_GIG_FACTOR); | ||
317 | |||
318 | if (drv->raid_level > 5) | ||
319 | drv->raid_level = RAID_UNKNOWN; | ||
320 | seq_printf(seq, "cciss/c%dd%d:" | ||
321 | "\t%4u.%02uGB\tRAID %s\n", | ||
322 | ctlr, (int) *pos, (int)vol_sz, (int)vol_sz_frac, | ||
323 | raid_label[drv->raid_level]); | ||
324 | return 0; | ||
325 | } | ||
326 | |||
327 | static void *cciss_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
328 | { | ||
329 | ctlr_info_t *h = seq->private; | ||
330 | |||
331 | if (*pos > h->highest_lun) | ||
332 | return NULL; | ||
333 | *pos += 1; | ||
334 | |||
335 | return pos; | ||
336 | } | ||
337 | |||
338 | static void cciss_seq_stop(struct seq_file *seq, void *v) | ||
339 | { | ||
340 | ctlr_info_t *h = seq->private; | ||
341 | |||
342 | /* Only reset h->busy_configuring if we succeeded in setting | ||
343 | * it during cciss_seq_start. */ | ||
344 | if (v == ERR_PTR(-EBUSY)) | ||
345 | return; | ||
307 | 346 | ||
308 | if (drv->raid_level > 5) | ||
309 | drv->raid_level = RAID_UNKNOWN; | ||
310 | size = sprintf(buffer + len, "cciss/c%dd%d:" | ||
311 | "\t%4u.%02uGB\tRAID %s\n", | ||
312 | ctlr, i, (int)vol_sz, (int)vol_sz_frac, | ||
313 | raid_label[drv->raid_level]); | ||
314 | pos += size; | ||
315 | len += size; | ||
316 | } | ||
317 | |||
318 | *eof = 1; | ||
319 | *start = buffer + offset; | ||
320 | len -= offset; | ||
321 | if (len > length) | ||
322 | len = length; | ||
323 | h->busy_configuring = 0; | 347 | h->busy_configuring = 0; |
324 | return len; | ||
325 | } | 348 | } |
326 | 349 | ||
327 | static int | 350 | static struct seq_operations cciss_seq_ops = { |
328 | cciss_proc_write(struct file *file, const char __user *buffer, | 351 | .start = cciss_seq_start, |
329 | unsigned long count, void *data) | 352 | .show = cciss_seq_show, |
353 | .next = cciss_seq_next, | ||
354 | .stop = cciss_seq_stop, | ||
355 | }; | ||
356 | |||
357 | static int cciss_seq_open(struct inode *inode, struct file *file) | ||
330 | { | 358 | { |
331 | unsigned char cmd[80]; | 359 | int ret = seq_open(file, &cciss_seq_ops); |
332 | int len; | 360 | struct seq_file *seq = file->private_data; |
333 | #ifdef CONFIG_CISS_SCSI_TAPE | 361 | |
334 | ctlr_info_t *h = (ctlr_info_t *) data; | 362 | if (!ret) |
335 | int rc; | 363 | seq->private = PDE(inode)->data; |
364 | |||
365 | return ret; | ||
366 | } | ||
367 | |||
368 | static ssize_t | ||
369 | cciss_proc_write(struct file *file, const char __user *buf, | ||
370 | size_t length, loff_t *ppos) | ||
371 | { | ||
372 | int err; | ||
373 | char *buffer; | ||
374 | |||
375 | #ifndef CONFIG_CISS_SCSI_TAPE | ||
376 | return -EINVAL; | ||
336 | #endif | 377 | #endif |
337 | 378 | ||
338 | if (count > sizeof(cmd) - 1) | 379 | if (!buf || length > PAGE_SIZE - 1) |
339 | return -EINVAL; | 380 | return -EINVAL; |
340 | if (copy_from_user(cmd, buffer, count)) | 381 | |
341 | return -EFAULT; | 382 | buffer = (char *)__get_free_page(GFP_KERNEL); |
342 | cmd[count] = '\0'; | 383 | if (!buffer) |
343 | len = strlen(cmd); // above 3 lines ensure safety | 384 | return -ENOMEM; |
344 | if (len && cmd[len - 1] == '\n') | 385 | |
345 | cmd[--len] = '\0'; | 386 | err = -EFAULT; |
346 | # ifdef CONFIG_CISS_SCSI_TAPE | 387 | if (copy_from_user(buffer, buf, length)) |
347 | if (strcmp("engage scsi", cmd) == 0) { | 388 | goto out; |
389 | buffer[length] = '\0'; | ||
390 | |||
391 | #ifdef CONFIG_CISS_SCSI_TAPE | ||
392 | if (strncmp(ENGAGE_SCSI, buffer, sizeof ENGAGE_SCSI - 1) == 0) { | ||
393 | struct seq_file *seq = file->private_data; | ||
394 | ctlr_info_t *h = seq->private; | ||
395 | int rc; | ||
396 | |||
348 | rc = cciss_engage_scsi(h->ctlr); | 397 | rc = cciss_engage_scsi(h->ctlr); |
349 | if (rc != 0) | 398 | if (rc != 0) |
350 | return -rc; | 399 | err = -rc; |
351 | return count; | 400 | else |
352 | } | 401 | err = length; |
402 | } else | ||
403 | #endif /* CONFIG_CISS_SCSI_TAPE */ | ||
404 | err = -EINVAL; | ||
353 | /* might be nice to have "disengage" too, but it's not | 405 | /* might be nice to have "disengage" too, but it's not |
354 | safely possible. (only 1 module use count, lock issues.) */ | 406 | safely possible. (only 1 module use count, lock issues.) */ |
355 | # endif | 407 | |
356 | return -EINVAL; | 408 | out: |
409 | free_page((unsigned long)buffer); | ||
410 | return err; | ||
357 | } | 411 | } |
358 | 412 | ||
359 | /* | 413 | static struct file_operations cciss_proc_fops = { |
360 | * Get us a file in /proc/cciss that says something about each controller. | 414 | .owner = THIS_MODULE, |
361 | * Create /proc/cciss if it doesn't exist yet. | 415 | .open = cciss_seq_open, |
362 | */ | 416 | .read = seq_read, |
417 | .llseek = seq_lseek, | ||
418 | .release = seq_release, | ||
419 | .write = cciss_proc_write, | ||
420 | }; | ||
421 | |||
363 | static void __devinit cciss_procinit(int i) | 422 | static void __devinit cciss_procinit(int i) |
364 | { | 423 | { |
365 | struct proc_dir_entry *pde; | 424 | struct proc_dir_entry *pde; |
366 | 425 | ||
367 | if (proc_cciss == NULL) { | 426 | if (proc_cciss == NULL) |
368 | proc_cciss = proc_mkdir("cciss", proc_root_driver); | 427 | proc_cciss = proc_mkdir("cciss", proc_root_driver); |
369 | if (!proc_cciss) | 428 | if (!proc_cciss) |
370 | return; | 429 | return; |
371 | } | 430 | pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP | |
431 | S_IROTH, proc_cciss, | ||
432 | &cciss_proc_fops); | ||
433 | if (!pde) | ||
434 | return; | ||
372 | 435 | ||
373 | pde = create_proc_read_entry(hba[i]->devname, | 436 | pde->data = hba[i]; |
374 | S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH, | ||
375 | proc_cciss, cciss_proc_get_info, hba[i]); | ||
376 | pde->write_proc = cciss_proc_write; | ||
377 | } | 437 | } |
378 | #endif /* CONFIG_PROC_FS */ | 438 | #endif /* CONFIG_PROC_FS */ |
379 | 439 | ||
@@ -1341,7 +1401,6 @@ geo_inq: | |||
1341 | disk->private_data = &h->drv[drv_index]; | 1401 | disk->private_data = &h->drv[drv_index]; |
1342 | 1402 | ||
1343 | /* Set up queue information */ | 1403 | /* Set up queue information */ |
1344 | disk->queue->backing_dev_info.ra_pages = READ_AHEAD; | ||
1345 | blk_queue_bounce_limit(disk->queue, hba[ctlr]->pdev->dma_mask); | 1404 | blk_queue_bounce_limit(disk->queue, hba[ctlr]->pdev->dma_mask); |
1346 | 1405 | ||
1347 | /* This is a hardware imposed limit. */ | 1406 | /* This is a hardware imposed limit. */ |
@@ -3434,7 +3493,6 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3434 | } | 3493 | } |
3435 | drv->queue = q; | 3494 | drv->queue = q; |
3436 | 3495 | ||
3437 | q->backing_dev_info.ra_pages = READ_AHEAD; | ||
3438 | blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); | 3496 | blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); |
3439 | 3497 | ||
3440 | /* This is a hardware imposed limit. */ | 3498 | /* This is a hardware imposed limit. */ |
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 55178e9973a0..45ac09300eb3 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -1404,21 +1404,18 @@ cciss_engage_scsi(int ctlr) | |||
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | static void | 1406 | static void |
1407 | cciss_proc_tape_report(int ctlr, unsigned char *buffer, off_t *pos, off_t *len) | 1407 | cciss_seq_tape_report(struct seq_file *seq, int ctlr) |
1408 | { | 1408 | { |
1409 | unsigned long flags; | 1409 | unsigned long flags; |
1410 | int size; | ||
1411 | |||
1412 | *pos = *pos -1; *len = *len - 1; // cut off the last trailing newline | ||
1413 | 1410 | ||
1414 | CPQ_TAPE_LOCK(ctlr, flags); | 1411 | CPQ_TAPE_LOCK(ctlr, flags); |
1415 | size = sprintf(buffer + *len, | 1412 | seq_printf(seq, |
1416 | "Sequential access devices: %d\n\n", | 1413 | "Sequential access devices: %d\n\n", |
1417 | ccissscsi[ctlr].ndevices); | 1414 | ccissscsi[ctlr].ndevices); |
1418 | CPQ_TAPE_UNLOCK(ctlr, flags); | 1415 | CPQ_TAPE_UNLOCK(ctlr, flags); |
1419 | *pos += size; *len += size; | ||
1420 | } | 1416 | } |
1421 | 1417 | ||
1418 | |||
1422 | /* Need at least one of these error handlers to keep ../scsi/hosts.c from | 1419 | /* Need at least one of these error handlers to keep ../scsi/hosts.c from |
1423 | * complaining. Doing a host- or bus-reset can't do anything good here. | 1420 | * complaining. Doing a host- or bus-reset can't do anything good here. |
1424 | * Despite what it might say in scsi_error.c, there may well be commands | 1421 | * Despite what it might say in scsi_error.c, there may well be commands |
@@ -1498,6 +1495,5 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd) | |||
1498 | #define cciss_scsi_setup(cntl_num) | 1495 | #define cciss_scsi_setup(cntl_num) |
1499 | #define cciss_unregister_scsi(ctlr) | 1496 | #define cciss_unregister_scsi(ctlr) |
1500 | #define cciss_register_scsi(ctlr) | 1497 | #define cciss_register_scsi(ctlr) |
1501 | #define cciss_proc_tape_report(ctlr, buffer, pos, len) | ||
1502 | 1498 | ||
1503 | #endif /* CONFIG_CISS_SCSI_TAPE */ | 1499 | #endif /* CONFIG_CISS_SCSI_TAPE */ |
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index db259e60289b..12f5baea439b 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -1152,8 +1152,8 @@ clean_up_and_return: | |||
1152 | /* This code is similar to that in open_for_data. The routine is called | 1152 | /* This code is similar to that in open_for_data. The routine is called |
1153 | whenever an audio play operation is requested. | 1153 | whenever an audio play operation is requested. |
1154 | */ | 1154 | */ |
1155 | int check_for_audio_disc(struct cdrom_device_info * cdi, | 1155 | static int check_for_audio_disc(struct cdrom_device_info * cdi, |
1156 | struct cdrom_device_ops * cdo) | 1156 | struct cdrom_device_ops * cdo) |
1157 | { | 1157 | { |
1158 | int ret; | 1158 | int ret; |
1159 | tracktype tracks; | 1159 | tracktype tracks; |
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 468805d40e2b..2d563979cb02 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/interrupt.h> | 32 | #include <linux/interrupt.h> |
33 | #include <linux/swap.h> | 33 | #include <linux/swap.h> |
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <linux/genhd.h> | ||
35 | #include <linux/smp.h> | 36 | #include <linux/smp.h> |
36 | #include <linux/signal.h> | 37 | #include <linux/signal.h> |
37 | #include <linux/module.h> | 38 | #include <linux/module.h> |
@@ -377,7 +378,6 @@ static int stram_read_proc(char *page, char **start, off_t off, | |||
377 | #endif | 378 | #endif |
378 | 379 | ||
379 | #ifdef CONFIG_BLOCK | 380 | #ifdef CONFIG_BLOCK |
380 | extern const struct seq_operations partitions_op; | ||
381 | static int partitions_open(struct inode *inode, struct file *file) | 381 | static int partitions_open(struct inode *inode, struct file *file) |
382 | { | 382 | { |
383 | return seq_open(file, &partitions_op); | 383 | return seq_open(file, &partitions_op); |
@@ -389,7 +389,6 @@ static const struct file_operations proc_partitions_operations = { | |||
389 | .release = seq_release, | 389 | .release = seq_release, |
390 | }; | 390 | }; |
391 | 391 | ||
392 | extern const struct seq_operations diskstats_op; | ||
393 | static int diskstats_open(struct inode *inode, struct file *file) | 392 | static int diskstats_open(struct inode *inode, struct file *file) |
394 | { | 393 | { |
395 | return seq_open(file, &diskstats_op); | 394 | return seq_open(file, &diskstats_op); |
diff --git a/fs/splice.c b/fs/splice.c index 9b559ee711a8..0670c915cd35 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1669,6 +1669,13 @@ static int link_pipe(struct pipe_inode_info *ipipe, | |||
1669 | i++; | 1669 | i++; |
1670 | } while (len); | 1670 | } while (len); |
1671 | 1671 | ||
1672 | /* | ||
1673 | * return EAGAIN if we have the potential of some data in the | ||
1674 | * future, otherwise just return 0 | ||
1675 | */ | ||
1676 | if (!ret && ipipe->waiting_writers && (flags & SPLICE_F_NONBLOCK)) | ||
1677 | ret = -EAGAIN; | ||
1678 | |||
1672 | inode_double_unlock(ipipe->inode, opipe->inode); | 1679 | inode_double_unlock(ipipe->inode, opipe->inode); |
1673 | 1680 | ||
1674 | /* | 1681 | /* |
@@ -1709,11 +1716,8 @@ static long do_tee(struct file *in, struct file *out, size_t len, | |||
1709 | ret = link_ipipe_prep(ipipe, flags); | 1716 | ret = link_ipipe_prep(ipipe, flags); |
1710 | if (!ret) { | 1717 | if (!ret) { |
1711 | ret = link_opipe_prep(opipe, flags); | 1718 | ret = link_opipe_prep(opipe, flags); |
1712 | if (!ret) { | 1719 | if (!ret) |
1713 | ret = link_pipe(ipipe, opipe, len, flags); | 1720 | ret = link_pipe(ipipe, opipe, len, flags); |
1714 | if (!ret && (flags & SPLICE_F_NONBLOCK)) | ||
1715 | ret = -EAGAIN; | ||
1716 | } | ||
1717 | } | 1721 | } |
1718 | } | 1722 | } |
1719 | 1723 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6fe67d1939c2..6f79d40dd3c0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -216,8 +216,8 @@ struct request { | |||
216 | unsigned int cmd_len; | 216 | unsigned int cmd_len; |
217 | unsigned char cmd[BLK_MAX_CDB]; | 217 | unsigned char cmd[BLK_MAX_CDB]; |
218 | 218 | ||
219 | unsigned int raw_data_len; | ||
220 | unsigned int data_len; | 219 | unsigned int data_len; |
220 | unsigned int extra_len; /* length of alignment and padding */ | ||
221 | unsigned int sense_len; | 221 | unsigned int sense_len; |
222 | void *data; | 222 | void *data; |
223 | void *sense; | 223 | void *sense; |
@@ -362,6 +362,7 @@ struct request_queue | |||
362 | unsigned long seg_boundary_mask; | 362 | unsigned long seg_boundary_mask; |
363 | void *dma_drain_buffer; | 363 | void *dma_drain_buffer; |
364 | unsigned int dma_drain_size; | 364 | unsigned int dma_drain_size; |
365 | unsigned int dma_pad_mask; | ||
365 | unsigned int dma_alignment; | 366 | unsigned int dma_alignment; |
366 | 367 | ||
367 | struct blk_queue_tag *queue_tags; | 368 | struct blk_queue_tag *queue_tags; |
@@ -701,6 +702,7 @@ extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); | |||
701 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 702 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
702 | extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); | 703 | extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); |
703 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); | 704 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
705 | extern void blk_queue_dma_pad(struct request_queue *, unsigned int); | ||
704 | extern int blk_queue_dma_drain(struct request_queue *q, | 706 | extern int blk_queue_dma_drain(struct request_queue *q, |
705 | dma_drain_needed_fn *dma_drain_needed, | 707 | dma_drain_needed_fn *dma_drain_needed, |
706 | void *buf, unsigned int size); | 708 | void *buf, unsigned int size); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 09a3b18918c7..32c2ac49a070 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -18,11 +18,13 @@ | |||
18 | #define dev_to_disk(device) container_of(device, struct gendisk, dev) | 18 | #define dev_to_disk(device) container_of(device, struct gendisk, dev) |
19 | #define dev_to_part(device) container_of(device, struct hd_struct, dev) | 19 | #define dev_to_part(device) container_of(device, struct hd_struct, dev) |
20 | 20 | ||
21 | extern struct device_type disk_type; | ||
22 | extern struct device_type part_type; | 21 | extern struct device_type part_type; |
23 | extern struct kobject *block_depr; | 22 | extern struct kobject *block_depr; |
24 | extern struct class block_class; | 23 | extern struct class block_class; |
25 | 24 | ||
25 | extern const struct seq_operations partitions_op; | ||
26 | extern const struct seq_operations diskstats_op; | ||
27 | |||
26 | enum { | 28 | enum { |
27 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 29 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
28 | confused about extended/logical partitions starting past cylinder 1023. */ | 30 | confused about extended/logical partitions starting past cylinder 1023. */ |
@@ -556,7 +558,6 @@ extern struct gendisk *alloc_disk_node(int minors, int node_id); | |||
556 | extern struct gendisk *alloc_disk(int minors); | 558 | extern struct gendisk *alloc_disk(int minors); |
557 | extern struct kobject *get_disk(struct gendisk *disk); | 559 | extern struct kobject *get_disk(struct gendisk *disk); |
558 | extern void put_disk(struct gendisk *disk); | 560 | extern void put_disk(struct gendisk *disk); |
559 | extern void genhd_media_change_notify(struct gendisk *disk); | ||
560 | extern void blk_register_region(dev_t devt, unsigned long range, | 561 | extern void blk_register_region(dev_t devt, unsigned long range, |
561 | struct module *module, | 562 | struct module *module, |
562 | struct kobject *(*probe)(dev_t, int *, void *), | 563 | struct kobject *(*probe)(dev_t, int *, void *), |