diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-03 19:45:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-03 19:45:56 -0500 |
commit | feaf3848a813a106f163013af6fcf6c4bfec92d9 (patch) | |
tree | a5b2db24fa361e96efb64442f48e463154a66f8b | |
parent | a771132783d3f78a51597fdcee96c6dfbae3512e (diff) | |
parent | 0e435ac26e3f951d83338ed3d4ab7dc0fe0055bc (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: fix setting of max_segment_size and seg_boundary mask
block: internal dequeue shouldn't start timer
block: set disk->node_id before it's being used
When block layer fails to map iov, it calls bio_unmap_user to undo
-rw-r--r-- | block/blk-barrier.c | 4 | ||||
-rw-r--r-- | block/blk-core.c | 26 | ||||
-rw-r--r-- | block/blk-map.c | 2 | ||||
-rw-r--r-- | block/blk-settings.c | 4 | ||||
-rw-r--r-- | block/elevator.c | 7 | ||||
-rw-r--r-- | block/genhd.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-table.c | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 9 |
8 files changed, 37 insertions, 19 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 5c99ff8d2db8..6e72d661ae42 100644 --- a/block/blk-barrier.c +++ b/block/blk-barrier.c | |||
@@ -161,7 +161,7 @@ static inline struct request *start_ordered(struct request_queue *q, | |||
161 | /* | 161 | /* |
162 | * Prep proxy barrier request. | 162 | * Prep proxy barrier request. |
163 | */ | 163 | */ |
164 | blkdev_dequeue_request(rq); | 164 | elv_dequeue_request(q, rq); |
165 | q->orig_bar_rq = rq; | 165 | q->orig_bar_rq = rq; |
166 | rq = &q->bar_rq; | 166 | rq = &q->bar_rq; |
167 | blk_rq_init(q, rq); | 167 | blk_rq_init(q, rq); |
@@ -219,7 +219,7 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp) | |||
219 | * This can happen when the queue switches to | 219 | * This can happen when the queue switches to |
220 | * ORDERED_NONE while this request is on it. | 220 | * ORDERED_NONE while this request is on it. |
221 | */ | 221 | */ |
222 | blkdev_dequeue_request(rq); | 222 | elv_dequeue_request(q, rq); |
223 | if (__blk_end_request(rq, -EOPNOTSUPP, | 223 | if (__blk_end_request(rq, -EOPNOTSUPP, |
224 | blk_rq_bytes(rq))) | 224 | blk_rq_bytes(rq))) |
225 | BUG(); | 225 | BUG(); |
diff --git a/block/blk-core.c b/block/blk-core.c index 10e8a64a5a5b..c36aa98fafa3 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -592,7 +592,7 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
592 | 1 << QUEUE_FLAG_STACKABLE); | 592 | 1 << QUEUE_FLAG_STACKABLE); |
593 | q->queue_lock = lock; | 593 | q->queue_lock = lock; |
594 | 594 | ||
595 | blk_queue_segment_boundary(q, 0xffffffff); | 595 | blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK); |
596 | 596 | ||
597 | blk_queue_make_request(q, __make_request); | 597 | blk_queue_make_request(q, __make_request); |
598 | blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); | 598 | blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); |
@@ -1637,6 +1637,28 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) | |||
1637 | EXPORT_SYMBOL_GPL(blk_insert_cloned_request); | 1637 | EXPORT_SYMBOL_GPL(blk_insert_cloned_request); |
1638 | 1638 | ||
1639 | /** | 1639 | /** |
1640 | * blkdev_dequeue_request - dequeue request and start timeout timer | ||
1641 | * @req: request to dequeue | ||
1642 | * | ||
1643 | * Dequeue @req and start timeout timer on it. This hands off the | ||
1644 | * request to the driver. | ||
1645 | * | ||
1646 | * Block internal functions which don't want to start timer should | ||
1647 | * call elv_dequeue_request(). | ||
1648 | */ | ||
1649 | void blkdev_dequeue_request(struct request *req) | ||
1650 | { | ||
1651 | elv_dequeue_request(req->q, req); | ||
1652 | |||
1653 | /* | ||
1654 | * We are now handing the request to the hardware, add the | ||
1655 | * timeout handler. | ||
1656 | */ | ||
1657 | blk_add_timer(req); | ||
1658 | } | ||
1659 | EXPORT_SYMBOL(blkdev_dequeue_request); | ||
1660 | |||
1661 | /** | ||
1640 | * __end_that_request_first - end I/O on a request | 1662 | * __end_that_request_first - end I/O on a request |
1641 | * @req: the request being processed | 1663 | * @req: the request being processed |
1642 | * @error: %0 for success, < %0 for error | 1664 | * @error: %0 for success, < %0 for error |
@@ -1774,7 +1796,7 @@ static void end_that_request_last(struct request *req, int error) | |||
1774 | blk_queue_end_tag(req->q, req); | 1796 | blk_queue_end_tag(req->q, req); |
1775 | 1797 | ||
1776 | if (blk_queued_rq(req)) | 1798 | if (blk_queued_rq(req)) |
1777 | blkdev_dequeue_request(req); | 1799 | elv_dequeue_request(req->q, req); |
1778 | 1800 | ||
1779 | if (unlikely(laptop_mode) && blk_fs_request(req)) | 1801 | if (unlikely(laptop_mode) && blk_fs_request(req)) |
1780 | laptop_io_completion(); | 1802 | laptop_io_completion(); |
diff --git a/block/blk-map.c b/block/blk-map.c index 0f4b4b881811..2990447f45e9 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -224,7 +224,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
224 | */ | 224 | */ |
225 | bio_get(bio); | 225 | bio_get(bio); |
226 | bio_endio(bio, 0); | 226 | bio_endio(bio, 0); |
227 | bio_unmap_user(bio); | 227 | __blk_rq_unmap_user(bio); |
228 | return -EINVAL; | 228 | return -EINVAL; |
229 | } | 229 | } |
230 | 230 | ||
diff --git a/block/blk-settings.c b/block/blk-settings.c index 41392fbe19ff..afa55e14e278 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -125,6 +125,9 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn) | |||
125 | q->nr_requests = BLKDEV_MAX_RQ; | 125 | q->nr_requests = BLKDEV_MAX_RQ; |
126 | blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); | 126 | blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); |
127 | blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); | 127 | blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); |
128 | blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK); | ||
129 | blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); | ||
130 | |||
128 | q->make_request_fn = mfn; | 131 | q->make_request_fn = mfn; |
129 | q->backing_dev_info.ra_pages = | 132 | q->backing_dev_info.ra_pages = |
130 | (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; | 133 | (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; |
@@ -314,6 +317,7 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b) | |||
314 | /* zero is "infinity" */ | 317 | /* zero is "infinity" */ |
315 | t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors); | 318 | t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors); |
316 | t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors); | 319 | t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors); |
320 | t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask, b->seg_boundary_mask); | ||
317 | 321 | ||
318 | t->max_phys_segments = min(t->max_phys_segments, b->max_phys_segments); | 322 | t->max_phys_segments = min(t->max_phys_segments, b->max_phys_segments); |
319 | t->max_hw_segments = min(t->max_hw_segments, b->max_hw_segments); | 323 | t->max_hw_segments = min(t->max_hw_segments, b->max_hw_segments); |
diff --git a/block/elevator.c b/block/elevator.c index 9ac82dde99dd..a6951f76ba0c 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -844,14 +844,7 @@ void elv_dequeue_request(struct request_queue *q, struct request *rq) | |||
844 | */ | 844 | */ |
845 | if (blk_account_rq(rq)) | 845 | if (blk_account_rq(rq)) |
846 | q->in_flight++; | 846 | q->in_flight++; |
847 | |||
848 | /* | ||
849 | * We are now handing the request to the hardware, add the | ||
850 | * timeout handler. | ||
851 | */ | ||
852 | blk_add_timer(rq); | ||
853 | } | 847 | } |
854 | EXPORT_SYMBOL(elv_dequeue_request); | ||
855 | 848 | ||
856 | int elv_queue_empty(struct request_queue *q) | 849 | int elv_queue_empty(struct request_queue *q) |
857 | { | 850 | { |
diff --git a/block/genhd.c b/block/genhd.c index 27549e470da5..2f7feda61e35 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -1102,6 +1102,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id) | |||
1102 | kfree(disk); | 1102 | kfree(disk); |
1103 | return NULL; | 1103 | return NULL; |
1104 | } | 1104 | } |
1105 | disk->node_id = node_id; | ||
1105 | if (disk_expand_part_tbl(disk, 0)) { | 1106 | if (disk_expand_part_tbl(disk, 0)) { |
1106 | free_part_stats(&disk->part0); | 1107 | free_part_stats(&disk->part0); |
1107 | kfree(disk); | 1108 | kfree(disk); |
@@ -1116,7 +1117,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id) | |||
1116 | device_initialize(disk_to_dev(disk)); | 1117 | device_initialize(disk_to_dev(disk)); |
1117 | INIT_WORK(&disk->async_notify, | 1118 | INIT_WORK(&disk->async_notify, |
1118 | media_change_notify_thread); | 1119 | media_change_notify_thread); |
1119 | disk->node_id = node_id; | ||
1120 | } | 1120 | } |
1121 | return disk; | 1121 | return disk; |
1122 | } | 1122 | } |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index a63161aec487..04e5fd742c2c 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -668,7 +668,7 @@ static void check_for_valid_limits(struct io_restrictions *rs) | |||
668 | if (!rs->max_segment_size) | 668 | if (!rs->max_segment_size) |
669 | rs->max_segment_size = MAX_SEGMENT_SIZE; | 669 | rs->max_segment_size = MAX_SEGMENT_SIZE; |
670 | if (!rs->seg_boundary_mask) | 670 | if (!rs->seg_boundary_mask) |
671 | rs->seg_boundary_mask = -1; | 671 | rs->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK; |
672 | if (!rs->bounce_pfn) | 672 | if (!rs->bounce_pfn) |
673 | rs->bounce_pfn = -1; | 673 | rs->bounce_pfn = -1; |
674 | } | 674 | } |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a135256b272c..6dcd30d806cd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -786,6 +786,8 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
786 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | 786 | blk_run_backing_dev(mapping->backing_dev_info, NULL); |
787 | } | 787 | } |
788 | 788 | ||
789 | extern void blkdev_dequeue_request(struct request *req); | ||
790 | |||
789 | /* | 791 | /* |
790 | * blk_end_request() and friends. | 792 | * blk_end_request() and friends. |
791 | * __blk_end_request() and end_request() must be called with | 793 | * __blk_end_request() and end_request() must be called with |
@@ -820,11 +822,6 @@ extern void blk_update_request(struct request *rq, int error, | |||
820 | extern unsigned int blk_rq_bytes(struct request *rq); | 822 | extern unsigned int blk_rq_bytes(struct request *rq); |
821 | extern unsigned int blk_rq_cur_bytes(struct request *rq); | 823 | extern unsigned int blk_rq_cur_bytes(struct request *rq); |
822 | 824 | ||
823 | static inline void blkdev_dequeue_request(struct request *req) | ||
824 | { | ||
825 | elv_dequeue_request(req->q, req); | ||
826 | } | ||
827 | |||
828 | /* | 825 | /* |
829 | * Access functions for manipulating queue properties | 826 | * Access functions for manipulating queue properties |
830 | */ | 827 | */ |
@@ -921,6 +918,8 @@ extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | |||
921 | 918 | ||
922 | #define MAX_SEGMENT_SIZE 65536 | 919 | #define MAX_SEGMENT_SIZE 65536 |
923 | 920 | ||
921 | #define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL | ||
922 | |||
924 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) | 923 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) |
925 | 924 | ||
926 | static inline int queue_hardsect_size(struct request_queue *q) | 925 | static inline int queue_hardsect_size(struct request_queue *q) |