aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-barrier.c4
-rw-r--r--block/blk-core.c26
-rw-r--r--block/blk-map.c2
-rw-r--r--block/blk-settings.c4
-rw-r--r--block/elevator.c7
-rw-r--r--block/genhd.c2
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 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)
1637EXPORT_SYMBOL_GPL(blk_insert_cloned_request); 1637EXPORT_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 */
1649void 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}
1659EXPORT_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}
854EXPORT_SYMBOL(elv_dequeue_request);
855 848
856int elv_queue_empty(struct request_queue *q) 849int 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}