diff options
Diffstat (limited to 'block')
-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 |
6 files changed, 32 insertions, 13 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 0c06cf5aaaf8..561e8a1b43a4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -600,7 +600,7 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
600 | 1 << QUEUE_FLAG_STACKABLE); | 600 | 1 << QUEUE_FLAG_STACKABLE); |
601 | q->queue_lock = lock; | 601 | q->queue_lock = lock; |
602 | 602 | ||
603 | blk_queue_segment_boundary(q, 0xffffffff); | 603 | blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK); |
604 | 604 | ||
605 | blk_queue_make_request(q, __make_request); | 605 | blk_queue_make_request(q, __make_request); |
606 | blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); | 606 | blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); |
@@ -1645,6 +1645,28 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) | |||
1645 | EXPORT_SYMBOL_GPL(blk_insert_cloned_request); | 1645 | EXPORT_SYMBOL_GPL(blk_insert_cloned_request); |
1646 | 1646 | ||
1647 | /** | 1647 | /** |
1648 | * blkdev_dequeue_request - dequeue request and start timeout timer | ||
1649 | * @req: request to dequeue | ||
1650 | * | ||
1651 | * Dequeue @req and start timeout timer on it. This hands off the | ||
1652 | * request to the driver. | ||
1653 | * | ||
1654 | * Block internal functions which don't want to start timer should | ||
1655 | * call elv_dequeue_request(). | ||
1656 | */ | ||
1657 | void blkdev_dequeue_request(struct request *req) | ||
1658 | { | ||
1659 | elv_dequeue_request(req->q, req); | ||
1660 | |||
1661 | /* | ||
1662 | * We are now handing the request to the hardware, add the | ||
1663 | * timeout handler. | ||
1664 | */ | ||
1665 | blk_add_timer(req); | ||
1666 | } | ||
1667 | EXPORT_SYMBOL(blkdev_dequeue_request); | ||
1668 | |||
1669 | /** | ||
1648 | * __end_that_request_first - end I/O on a request | 1670 | * __end_that_request_first - end I/O on a request |
1649 | * @req: the request being processed | 1671 | * @req: the request being processed |
1650 | * @error: %0 for success, < %0 for error | 1672 | * @error: %0 for success, < %0 for error |
@@ -1782,7 +1804,7 @@ static void end_that_request_last(struct request *req, int error) | |||
1782 | blk_queue_end_tag(req->q, req); | 1804 | blk_queue_end_tag(req->q, req); |
1783 | 1805 | ||
1784 | if (blk_queued_rq(req)) | 1806 | if (blk_queued_rq(req)) |
1785 | blkdev_dequeue_request(req); | 1807 | elv_dequeue_request(req->q, req); |
1786 | 1808 | ||
1787 | if (unlikely(laptop_mode) && blk_fs_request(req)) | 1809 | if (unlikely(laptop_mode) && blk_fs_request(req)) |
1788 | laptop_io_completion(); | 1810 | 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 e5677fe4f412..86836dd179c0 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -850,14 +850,7 @@ void elv_dequeue_request(struct request_queue *q, struct request *rq) | |||
850 | */ | 850 | */ |
851 | if (blk_account_rq(rq)) | 851 | if (blk_account_rq(rq)) |
852 | q->in_flight++; | 852 | q->in_flight++; |
853 | |||
854 | /* | ||
855 | * We are now handing the request to the hardware, add the | ||
856 | * timeout handler. | ||
857 | */ | ||
858 | blk_add_timer(rq); | ||
859 | } | 853 | } |
860 | EXPORT_SYMBOL(elv_dequeue_request); | ||
861 | 854 | ||
862 | int elv_queue_empty(struct request_queue *q) | 855 | int elv_queue_empty(struct request_queue *q) |
863 | { | 856 | { |
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 | } |