aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c14
-rw-r--r--block/blk-cgroup.h3
-rw-r--r--block/blk-core.c34
-rw-r--r--block/blk-ioc.c2
-rw-r--r--block/blk-merge.c8
-rw-r--r--block/blk-settings.c131
-rw-r--r--block/blk-sysfs.c11
-rw-r--r--block/cfq-iosched.c147
-rw-r--r--block/elevator.c11
9 files changed, 145 insertions, 216 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index e7dbbaf5fb3e..c85d74cae200 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -23,20 +23,6 @@ static LIST_HEAD(blkio_list);
23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; 23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
24EXPORT_SYMBOL_GPL(blkio_root_cgroup); 24EXPORT_SYMBOL_GPL(blkio_root_cgroup);
25 25
26bool blkiocg_css_tryget(struct blkio_cgroup *blkcg)
27{
28 if (!css_tryget(&blkcg->css))
29 return false;
30 return true;
31}
32EXPORT_SYMBOL_GPL(blkiocg_css_tryget);
33
34void blkiocg_css_put(struct blkio_cgroup *blkcg)
35{
36 css_put(&blkcg->css);
37}
38EXPORT_SYMBOL_GPL(blkiocg_css_put);
39
40struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) 26struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup)
41{ 27{
42 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), 28 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id),
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 4d316df863b4..84bf745fa775 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -43,9 +43,6 @@ struct blkio_group {
43 unsigned long sectors; 43 unsigned long sectors;
44}; 44};
45 45
46extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
47extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
48
49typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); 46typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
50typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, 47typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
51 unsigned int weight); 48 unsigned int weight);
diff --git a/block/blk-core.c b/block/blk-core.c
index d1a9a0a64f95..9fe174dc74d1 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1490,9 +1490,9 @@ end_io:
1490/* 1490/*
1491 * We only want one ->make_request_fn to be active at a time, 1491 * We only want one ->make_request_fn to be active at a time,
1492 * else stack usage with stacked devices could be a problem. 1492 * else stack usage with stacked devices could be a problem.
1493 * So use current->bio_{list,tail} to keep a list of requests 1493 * So use current->bio_list to keep a list of requests
1494 * submited by a make_request_fn function. 1494 * submited by a make_request_fn function.
1495 * current->bio_tail is also used as a flag to say if 1495 * current->bio_list is also used as a flag to say if
1496 * generic_make_request is currently active in this task or not. 1496 * generic_make_request is currently active in this task or not.
1497 * If it is NULL, then no make_request is active. If it is non-NULL, 1497 * If it is NULL, then no make_request is active. If it is non-NULL,
1498 * then a make_request is active, and new requests should be added 1498 * then a make_request is active, and new requests should be added
@@ -1500,11 +1500,11 @@ end_io:
1500 */ 1500 */
1501void generic_make_request(struct bio *bio) 1501void generic_make_request(struct bio *bio)
1502{ 1502{
1503 if (current->bio_tail) { 1503 struct bio_list bio_list_on_stack;
1504
1505 if (current->bio_list) {
1504 /* make_request is active */ 1506 /* make_request is active */
1505 *(current->bio_tail) = bio; 1507 bio_list_add(current->bio_list, bio);
1506 bio->bi_next = NULL;
1507 current->bio_tail = &bio->bi_next;
1508 return; 1508 return;
1509 } 1509 }
1510 /* following loop may be a bit non-obvious, and so deserves some 1510 /* following loop may be a bit non-obvious, and so deserves some
@@ -1512,30 +1512,27 @@ void generic_make_request(struct bio *bio)
1512 * Before entering the loop, bio->bi_next is NULL (as all callers 1512 * Before entering the loop, bio->bi_next is NULL (as all callers
1513 * ensure that) so we have a list with a single bio. 1513 * ensure that) so we have a list with a single bio.
1514 * We pretend that we have just taken it off a longer list, so 1514 * We pretend that we have just taken it off a longer list, so
1515 * we assign bio_list to the next (which is NULL) and bio_tail 1515 * we assign bio_list to a pointer to the bio_list_on_stack,
1516 * to &bio_list, thus initialising the bio_list of new bios to be 1516 * thus initialising the bio_list of new bios to be
1517 * added. __generic_make_request may indeed add some more bios 1517 * added. __generic_make_request may indeed add some more bios
1518 * through a recursive call to generic_make_request. If it 1518 * through a recursive call to generic_make_request. If it
1519 * did, we find a non-NULL value in bio_list and re-enter the loop 1519 * did, we find a non-NULL value in bio_list and re-enter the loop
1520 * from the top. In this case we really did just take the bio 1520 * from the top. In this case we really did just take the bio
1521 * of the top of the list (no pretending) and so fixup bio_list and 1521 * of the top of the list (no pretending) and so remove it from
1522 * bio_tail or bi_next, and call into __generic_make_request again. 1522 * bio_list, and call into __generic_make_request again.
1523 * 1523 *
1524 * The loop was structured like this to make only one call to 1524 * The loop was structured like this to make only one call to
1525 * __generic_make_request (which is important as it is large and 1525 * __generic_make_request (which is important as it is large and
1526 * inlined) and to keep the structure simple. 1526 * inlined) and to keep the structure simple.
1527 */ 1527 */
1528 BUG_ON(bio->bi_next); 1528 BUG_ON(bio->bi_next);
1529 bio_list_init(&bio_list_on_stack);
1530 current->bio_list = &bio_list_on_stack;
1529 do { 1531 do {
1530 current->bio_list = bio->bi_next;
1531 if (bio->bi_next == NULL)
1532 current->bio_tail = &current->bio_list;
1533 else
1534 bio->bi_next = NULL;
1535 __generic_make_request(bio); 1532 __generic_make_request(bio);
1536 bio = current->bio_list; 1533 bio = bio_list_pop(current->bio_list);
1537 } while (bio); 1534 } while (bio);
1538 current->bio_tail = NULL; /* deactivate */ 1535 current->bio_list = NULL; /* deactivate */
1539} 1536}
1540EXPORT_SYMBOL(generic_make_request); 1537EXPORT_SYMBOL(generic_make_request);
1541 1538
@@ -1617,8 +1614,7 @@ int blk_rq_check_limits(struct request_queue *q, struct request *rq)
1617 * limitation. 1614 * limitation.
1618 */ 1615 */
1619 blk_recalc_rq_segments(rq); 1616 blk_recalc_rq_segments(rq);
1620 if (rq->nr_phys_segments > queue_max_phys_segments(q) || 1617 if (rq->nr_phys_segments > queue_max_segments(q)) {
1621 rq->nr_phys_segments > queue_max_hw_segments(q)) {
1622 printk(KERN_ERR "%s: over max segments limit.\n", __func__); 1618 printk(KERN_ERR "%s: over max segments limit.\n", __func__);
1623 return -EIO; 1619 return -EIO;
1624 } 1620 }
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 98e6bf61b0ac..3f65c8aadb2f 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -91,7 +91,7 @@ struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
91 spin_lock_init(&ret->lock); 91 spin_lock_init(&ret->lock);
92 ret->ioprio_changed = 0; 92 ret->ioprio_changed = 0;
93 ret->ioprio = 0; 93 ret->ioprio = 0;
94 ret->last_waited = jiffies; /* doesn't matter... */ 94 ret->last_waited = 0; /* doesn't matter... */
95 ret->nr_batch_requests = 0; /* because this is 0 */ 95 ret->nr_batch_requests = 0; /* because this is 0 */
96 INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH); 96 INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
97 INIT_HLIST_HEAD(&ret->cic_list); 97 INIT_HLIST_HEAD(&ret->cic_list);
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 99cb5cf1f447..5e7dc9973458 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -206,8 +206,7 @@ static inline int ll_new_hw_segment(struct request_queue *q,
206{ 206{
207 int nr_phys_segs = bio_phys_segments(q, bio); 207 int nr_phys_segs = bio_phys_segments(q, bio);
208 208
209 if (req->nr_phys_segments + nr_phys_segs > queue_max_hw_segments(q) || 209 if (req->nr_phys_segments + nr_phys_segs > queue_max_segments(q)) {
210 req->nr_phys_segments + nr_phys_segs > queue_max_phys_segments(q)) {
211 req->cmd_flags |= REQ_NOMERGE; 210 req->cmd_flags |= REQ_NOMERGE;
212 if (req == q->last_merge) 211 if (req == q->last_merge)
213 q->last_merge = NULL; 212 q->last_merge = NULL;
@@ -300,10 +299,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
300 total_phys_segments--; 299 total_phys_segments--;
301 } 300 }
302 301
303 if (total_phys_segments > queue_max_phys_segments(q)) 302 if (total_phys_segments > queue_max_segments(q))
304 return 0;
305
306 if (total_phys_segments > queue_max_hw_segments(q))
307 return 0; 303 return 0;
308 304
309 /* Merge is OK... */ 305 /* Merge is OK... */
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 5eeb9e0d256e..31e7a9375c13 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -91,10 +91,9 @@ EXPORT_SYMBOL_GPL(blk_queue_lld_busy);
91 */ 91 */
92void blk_set_default_limits(struct queue_limits *lim) 92void blk_set_default_limits(struct queue_limits *lim)
93{ 93{
94 lim->max_phys_segments = MAX_PHYS_SEGMENTS; 94 lim->max_segments = BLK_MAX_SEGMENTS;
95 lim->max_hw_segments = MAX_HW_SEGMENTS;
96 lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK; 95 lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
97 lim->max_segment_size = MAX_SEGMENT_SIZE; 96 lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
98 lim->max_sectors = BLK_DEF_MAX_SECTORS; 97 lim->max_sectors = BLK_DEF_MAX_SECTORS;
99 lim->max_hw_sectors = INT_MAX; 98 lim->max_hw_sectors = INT_MAX;
100 lim->max_discard_sectors = 0; 99 lim->max_discard_sectors = 0;
@@ -154,7 +153,7 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
154 q->unplug_timer.data = (unsigned long)q; 153 q->unplug_timer.data = (unsigned long)q;
155 154
156 blk_set_default_limits(&q->limits); 155 blk_set_default_limits(&q->limits);
157 blk_queue_max_sectors(q, SAFE_MAX_SECTORS); 156 blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
158 157
159 /* 158 /*
160 * If the caller didn't supply a lock, fall back to our embedded 159 * If the caller didn't supply a lock, fall back to our embedded
@@ -210,37 +209,32 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask)
210EXPORT_SYMBOL(blk_queue_bounce_limit); 209EXPORT_SYMBOL(blk_queue_bounce_limit);
211 210
212/** 211/**
213 * blk_queue_max_sectors - set max sectors for a request for this queue 212 * blk_queue_max_hw_sectors - set max sectors for a request for this queue
214 * @q: the request queue for the device 213 * @q: the request queue for the device
215 * @max_sectors: max sectors in the usual 512b unit 214 * @max_hw_sectors: max hardware sectors in the usual 512b unit
216 * 215 *
217 * Description: 216 * Description:
218 * Enables a low level driver to set an upper limit on the size of 217 * Enables a low level driver to set a hard upper limit,
219 * received requests. 218 * max_hw_sectors, on the size of requests. max_hw_sectors is set by
219 * the device driver based upon the combined capabilities of I/O
220 * controller and storage device.
221 *
222 * max_sectors is a soft limit imposed by the block layer for
223 * filesystem type requests. This value can be overridden on a
224 * per-device basis in /sys/block/<device>/queue/max_sectors_kb.
225 * The soft limit can not exceed max_hw_sectors.
220 **/ 226 **/
221void blk_queue_max_sectors(struct request_queue *q, unsigned int max_sectors) 227void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
222{ 228{
223 if ((max_sectors << 9) < PAGE_CACHE_SIZE) { 229 if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) {
224 max_sectors = 1 << (PAGE_CACHE_SHIFT - 9); 230 max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
225 printk(KERN_INFO "%s: set to minimum %d\n", 231 printk(KERN_INFO "%s: set to minimum %d\n",
226 __func__, max_sectors); 232 __func__, max_hw_sectors);
227 } 233 }
228 234
229 if (BLK_DEF_MAX_SECTORS > max_sectors) 235 q->limits.max_hw_sectors = max_hw_sectors;
230 q->limits.max_hw_sectors = q->limits.max_sectors = max_sectors; 236 q->limits.max_sectors = min_t(unsigned int, max_hw_sectors,
231 else { 237 BLK_DEF_MAX_SECTORS);
232 q->limits.max_sectors = BLK_DEF_MAX_SECTORS;
233 q->limits.max_hw_sectors = max_sectors;
234 }
235}
236EXPORT_SYMBOL(blk_queue_max_sectors);
237
238void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_sectors)
239{
240 if (BLK_DEF_MAX_SECTORS > max_sectors)
241 q->limits.max_hw_sectors = BLK_DEF_MAX_SECTORS;
242 else
243 q->limits.max_hw_sectors = max_sectors;
244} 238}
245EXPORT_SYMBOL(blk_queue_max_hw_sectors); 239EXPORT_SYMBOL(blk_queue_max_hw_sectors);
246 240
@@ -257,17 +251,15 @@ void blk_queue_max_discard_sectors(struct request_queue *q,
257EXPORT_SYMBOL(blk_queue_max_discard_sectors); 251EXPORT_SYMBOL(blk_queue_max_discard_sectors);
258 252
259/** 253/**
260 * blk_queue_max_phys_segments - set max phys segments for a request for this queue 254 * blk_queue_max_segments - set max hw segments for a request for this queue
261 * @q: the request queue for the device 255 * @q: the request queue for the device
262 * @max_segments: max number of segments 256 * @max_segments: max number of segments
263 * 257 *
264 * Description: 258 * Description:
265 * Enables a low level driver to set an upper limit on the number of 259 * Enables a low level driver to set an upper limit on the number of
266 * physical data segments in a request. This would be the largest sized 260 * hw data segments in a request.
267 * scatter list the driver could handle.
268 **/ 261 **/
269void blk_queue_max_phys_segments(struct request_queue *q, 262void blk_queue_max_segments(struct request_queue *q, unsigned short max_segments)
270 unsigned short max_segments)
271{ 263{
272 if (!max_segments) { 264 if (!max_segments) {
273 max_segments = 1; 265 max_segments = 1;
@@ -275,33 +267,9 @@ void blk_queue_max_phys_segments(struct request_queue *q,
275 __func__, max_segments); 267 __func__, max_segments);
276 } 268 }
277 269
278 q->limits.max_phys_segments = max_segments; 270 q->limits.max_segments = max_segments;
279} 271}
280EXPORT_SYMBOL(blk_queue_max_phys_segments); 272EXPORT_SYMBOL(blk_queue_max_segments);
281
282/**
283 * blk_queue_max_hw_segments - set max hw segments for a request for this queue
284 * @q: the request queue for the device
285 * @max_segments: max number of segments
286 *
287 * Description:
288 * Enables a low level driver to set an upper limit on the number of
289 * hw data segments in a request. This would be the largest number of
290 * address/length pairs the host adapter can actually give at once
291 * to the device.
292 **/
293void blk_queue_max_hw_segments(struct request_queue *q,
294 unsigned short max_segments)
295{
296 if (!max_segments) {
297 max_segments = 1;
298 printk(KERN_INFO "%s: set to minimum %d\n",
299 __func__, max_segments);
300 }
301
302 q->limits.max_hw_segments = max_segments;
303}
304EXPORT_SYMBOL(blk_queue_max_hw_segments);
305 273
306/** 274/**
307 * blk_queue_max_segment_size - set max segment size for blk_rq_map_sg 275 * blk_queue_max_segment_size - set max segment size for blk_rq_map_sg
@@ -507,7 +475,7 @@ static unsigned int lcm(unsigned int a, unsigned int b)
507 * blk_stack_limits - adjust queue_limits for stacked devices 475 * blk_stack_limits - adjust queue_limits for stacked devices
508 * @t: the stacking driver limits (top device) 476 * @t: the stacking driver limits (top device)
509 * @b: the underlying queue limits (bottom, component device) 477 * @b: the underlying queue limits (bottom, component device)
510 * @offset: offset to beginning of data within component device 478 * @start: first data sector within component device
511 * 479 *
512 * Description: 480 * Description:
513 * This function is used by stacking drivers like MD and DM to ensure 481 * This function is used by stacking drivers like MD and DM to ensure
@@ -525,10 +493,9 @@ static unsigned int lcm(unsigned int a, unsigned int b)
525 * the alignment_offset is undefined. 493 * the alignment_offset is undefined.
526 */ 494 */
527int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, 495int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
528 sector_t offset) 496 sector_t start)
529{ 497{
530 sector_t alignment; 498 unsigned int top, bottom, alignment, ret = 0;
531 unsigned int top, bottom, ret = 0;
532 499
533 t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors); 500 t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
534 t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors); 501 t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
@@ -537,18 +504,14 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
537 t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask, 504 t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask,
538 b->seg_boundary_mask); 505 b->seg_boundary_mask);
539 506
540 t->max_phys_segments = min_not_zero(t->max_phys_segments, 507 t->max_segments = min_not_zero(t->max_segments, b->max_segments);
541 b->max_phys_segments);
542
543 t->max_hw_segments = min_not_zero(t->max_hw_segments,
544 b->max_hw_segments);
545 508
546 t->max_segment_size = min_not_zero(t->max_segment_size, 509 t->max_segment_size = min_not_zero(t->max_segment_size,
547 b->max_segment_size); 510 b->max_segment_size);
548 511
549 t->misaligned |= b->misaligned; 512 t->misaligned |= b->misaligned;
550 513
551 alignment = queue_limit_alignment_offset(b, offset); 514 alignment = queue_limit_alignment_offset(b, start);
552 515
553 /* Bottom device has different alignment. Check that it is 516 /* Bottom device has different alignment. Check that it is
554 * compatible with the current top alignment. 517 * compatible with the current top alignment.
@@ -611,11 +574,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
611 574
612 /* Discard alignment and granularity */ 575 /* Discard alignment and granularity */
613 if (b->discard_granularity) { 576 if (b->discard_granularity) {
614 unsigned int granularity = b->discard_granularity; 577 alignment = queue_limit_discard_alignment(b, start);
615 offset &= granularity - 1;
616
617 alignment = (granularity + b->discard_alignment - offset)
618 & (granularity - 1);
619 578
620 if (t->discard_granularity != 0 && 579 if (t->discard_granularity != 0 &&
621 t->discard_alignment != alignment) { 580 t->discard_alignment != alignment) {
@@ -657,7 +616,7 @@ int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev,
657 616
658 start += get_start_sect(bdev); 617 start += get_start_sect(bdev);
659 618
660 return blk_stack_limits(t, &bq->limits, start << 9); 619 return blk_stack_limits(t, &bq->limits, start);
661} 620}
662EXPORT_SYMBOL(bdev_stack_limits); 621EXPORT_SYMBOL(bdev_stack_limits);
663 622
@@ -668,9 +627,8 @@ EXPORT_SYMBOL(bdev_stack_limits);
668 * @offset: offset to beginning of data within component device 627 * @offset: offset to beginning of data within component device
669 * 628 *
670 * Description: 629 * Description:
671 * Merges the limits for two queues. Returns 0 if alignment 630 * Merges the limits for a top level gendisk and a bottom level
672 * didn't change. Returns -1 if adding the bottom device caused 631 * block_device.
673 * misalignment.
674 */ 632 */
675void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, 633void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
676 sector_t offset) 634 sector_t offset)
@@ -678,9 +636,7 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
678 struct request_queue *t = disk->queue; 636 struct request_queue *t = disk->queue;
679 struct request_queue *b = bdev_get_queue(bdev); 637 struct request_queue *b = bdev_get_queue(bdev);
680 638
681 offset += get_start_sect(bdev) << 9; 639 if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) {
682
683 if (blk_stack_limits(&t->limits, &b->limits, offset) < 0) {
684 char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE]; 640 char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE];
685 641
686 disk_name(disk, 0, top); 642 disk_name(disk, 0, top);
@@ -752,22 +708,19 @@ EXPORT_SYMBOL(blk_queue_update_dma_pad);
752 * does is adjust the queue so that the buf is always appended 708 * does is adjust the queue so that the buf is always appended
753 * silently to the scatterlist. 709 * silently to the scatterlist.
754 * 710 *
755 * Note: This routine adjusts max_hw_segments to make room for 711 * Note: This routine adjusts max_hw_segments to make room for appending
756 * appending the drain buffer. If you call 712 * the drain buffer. If you call blk_queue_max_segments() after calling
757 * blk_queue_max_hw_segments() or blk_queue_max_phys_segments() after 713 * this routine, you must set the limit to one fewer than your device
758 * calling this routine, you must set the limit to one fewer than your 714 * can support otherwise there won't be room for the drain buffer.
759 * device can support otherwise there won't be room for the drain
760 * buffer.
761 */ 715 */
762int blk_queue_dma_drain(struct request_queue *q, 716int blk_queue_dma_drain(struct request_queue *q,
763 dma_drain_needed_fn *dma_drain_needed, 717 dma_drain_needed_fn *dma_drain_needed,
764 void *buf, unsigned int size) 718 void *buf, unsigned int size)
765{ 719{
766 if (queue_max_hw_segments(q) < 2 || queue_max_phys_segments(q) < 2) 720 if (queue_max_segments(q) < 2)
767 return -EINVAL; 721 return -EINVAL;
768 /* make room for appending the drain */ 722 /* make room for appending the drain */
769 blk_queue_max_hw_segments(q, queue_max_hw_segments(q) - 1); 723 blk_queue_max_segments(q, queue_max_segments(q) - 1);
770 blk_queue_max_phys_segments(q, queue_max_phys_segments(q) - 1);
771 q->dma_drain_needed = dma_drain_needed; 724 q->dma_drain_needed = dma_drain_needed;
772 q->dma_drain_buffer = buf; 725 q->dma_drain_buffer = buf;
773 q->dma_drain_size = size; 726 q->dma_drain_size = size;
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 8606c9543fdd..e85442415db3 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -189,7 +189,8 @@ static ssize_t queue_nonrot_store(struct request_queue *q, const char *page,
189 189
190static ssize_t queue_nomerges_show(struct request_queue *q, char *page) 190static ssize_t queue_nomerges_show(struct request_queue *q, char *page)
191{ 191{
192 return queue_var_show(blk_queue_nomerges(q), page); 192 return queue_var_show((blk_queue_nomerges(q) << 1) |
193 blk_queue_noxmerges(q), page);
193} 194}
194 195
195static ssize_t queue_nomerges_store(struct request_queue *q, const char *page, 196static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
@@ -199,10 +200,12 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
199 ssize_t ret = queue_var_store(&nm, page, count); 200 ssize_t ret = queue_var_store(&nm, page, count);
200 201
201 spin_lock_irq(q->queue_lock); 202 spin_lock_irq(q->queue_lock);
202 if (nm) 203 queue_flag_clear(QUEUE_FLAG_NOMERGES, q);
204 queue_flag_clear(QUEUE_FLAG_NOXMERGES, q);
205 if (nm == 2)
203 queue_flag_set(QUEUE_FLAG_NOMERGES, q); 206 queue_flag_set(QUEUE_FLAG_NOMERGES, q);
204 else 207 else if (nm)
205 queue_flag_clear(QUEUE_FLAG_NOMERGES, q); 208 queue_flag_set(QUEUE_FLAG_NOXMERGES, q);
206 spin_unlock_irq(q->queue_lock); 209 spin_unlock_irq(q->queue_lock);
207 210
208 return ret; 211 return ret;
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 023f4e69a337..dee9d9378fee 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -19,7 +19,7 @@
19 * tunables 19 * tunables
20 */ 20 */
21/* max queue in one round of service */ 21/* max queue in one round of service */
22static const int cfq_quantum = 4; 22static const int cfq_quantum = 8;
23static const int cfq_fifo_expire[2] = { HZ / 4, HZ / 8 }; 23static const int cfq_fifo_expire[2] = { HZ / 4, HZ / 8 };
24/* maximum backwards seek, in KiB */ 24/* maximum backwards seek, in KiB */
25static const int cfq_back_max = 16 * 1024; 25static const int cfq_back_max = 16 * 1024;
@@ -46,8 +46,9 @@ static const int cfq_hist_divisor = 4;
46#define CFQ_HW_QUEUE_MIN (5) 46#define CFQ_HW_QUEUE_MIN (5)
47#define CFQ_SERVICE_SHIFT 12 47#define CFQ_SERVICE_SHIFT 12
48 48
49#define CFQQ_SEEK_THR 8 * 1024 49#define CFQQ_SEEK_THR (sector_t)(8 * 100)
50#define CFQQ_SEEKY(cfqq) ((cfqq)->seek_mean > CFQQ_SEEK_THR) 50#define CFQQ_SECT_THR_NONROT (sector_t)(2 * 32)
51#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8)
51 52
52#define RQ_CIC(rq) \ 53#define RQ_CIC(rq) \
53 ((struct cfq_io_context *) (rq)->elevator_private) 54 ((struct cfq_io_context *) (rq)->elevator_private)
@@ -77,11 +78,12 @@ struct cfq_rb_root {
77 struct rb_root rb; 78 struct rb_root rb;
78 struct rb_node *left; 79 struct rb_node *left;
79 unsigned count; 80 unsigned count;
81 unsigned total_weight;
80 u64 min_vdisktime; 82 u64 min_vdisktime;
81 struct rb_node *active; 83 struct rb_node *active;
82 unsigned total_weight;
83}; 84};
84#define CFQ_RB_ROOT (struct cfq_rb_root) { RB_ROOT, NULL, 0, 0, } 85#define CFQ_RB_ROOT (struct cfq_rb_root) { .rb = RB_ROOT, .left = NULL, \
86 .count = 0, .min_vdisktime = 0, }
85 87
86/* 88/*
87 * Per process-grouping structure 89 * Per process-grouping structure
@@ -115,11 +117,11 @@ struct cfq_queue {
115 /* time when queue got scheduled in to dispatch first request. */ 117 /* time when queue got scheduled in to dispatch first request. */
116 unsigned long dispatch_start; 118 unsigned long dispatch_start;
117 unsigned int allocated_slice; 119 unsigned int allocated_slice;
120 unsigned int slice_dispatch;
118 /* time when first request from queue completed and slice started. */ 121 /* time when first request from queue completed and slice started. */
119 unsigned long slice_start; 122 unsigned long slice_start;
120 unsigned long slice_end; 123 unsigned long slice_end;
121 long slice_resid; 124 long slice_resid;
122 unsigned int slice_dispatch;
123 125
124 /* pending metadata requests */ 126 /* pending metadata requests */
125 int meta_pending; 127 int meta_pending;
@@ -130,13 +132,11 @@ struct cfq_queue {
130 unsigned short ioprio, org_ioprio; 132 unsigned short ioprio, org_ioprio;
131 unsigned short ioprio_class, org_ioprio_class; 133 unsigned short ioprio_class, org_ioprio_class;
132 134
133 unsigned int seek_samples;
134 u64 seek_total;
135 sector_t seek_mean;
136 sector_t last_request_pos;
137
138 pid_t pid; 135 pid_t pid;
139 136
137 u32 seek_history;
138 sector_t last_request_pos;
139
140 struct cfq_rb_root *service_tree; 140 struct cfq_rb_root *service_tree;
141 struct cfq_queue *new_cfqq; 141 struct cfq_queue *new_cfqq;
142 struct cfq_group *cfqg; 142 struct cfq_group *cfqg;
@@ -223,8 +223,8 @@ struct cfq_data {
223 223
224 unsigned int busy_queues; 224 unsigned int busy_queues;
225 225
226 int rq_in_driver[2]; 226 int rq_in_driver;
227 int sync_flight; 227 int rq_in_flight[2];
228 228
229 /* 229 /*
230 * queue-depth detection 230 * queue-depth detection
@@ -417,11 +417,6 @@ static struct cfq_queue *cfq_get_queue(struct cfq_data *, bool,
417static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *, 417static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *,
418 struct io_context *); 418 struct io_context *);
419 419
420static inline int rq_in_driver(struct cfq_data *cfqd)
421{
422 return cfqd->rq_in_driver[0] + cfqd->rq_in_driver[1];
423}
424
425static inline struct cfq_queue *cic_to_cfqq(struct cfq_io_context *cic, 420static inline struct cfq_queue *cic_to_cfqq(struct cfq_io_context *cic,
426 bool is_sync) 421 bool is_sync)
427{ 422{
@@ -951,10 +946,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
951 struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info; 946 struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info;
952 unsigned int major, minor; 947 unsigned int major, minor;
953 948
954 /* Do we need to take this reference */
955 if (!blkiocg_css_tryget(blkcg))
956 return NULL;;
957
958 cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key)); 949 cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
959 if (cfqg || !create) 950 if (cfqg || !create)
960 goto done; 951 goto done;
@@ -985,7 +976,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
985 hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list); 976 hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list);
986 977
987done: 978done:
988 blkiocg_css_put(blkcg);
989 return cfqg; 979 return cfqg;
990} 980}
991 981
@@ -1420,9 +1410,9 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq)
1420{ 1410{
1421 struct cfq_data *cfqd = q->elevator->elevator_data; 1411 struct cfq_data *cfqd = q->elevator->elevator_data;
1422 1412
1423 cfqd->rq_in_driver[rq_is_sync(rq)]++; 1413 cfqd->rq_in_driver++;
1424 cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d", 1414 cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d",
1425 rq_in_driver(cfqd)); 1415 cfqd->rq_in_driver);
1426 1416
1427 cfqd->last_position = blk_rq_pos(rq) + blk_rq_sectors(rq); 1417 cfqd->last_position = blk_rq_pos(rq) + blk_rq_sectors(rq);
1428} 1418}
@@ -1430,12 +1420,11 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq)
1430static void cfq_deactivate_request(struct request_queue *q, struct request *rq) 1420static void cfq_deactivate_request(struct request_queue *q, struct request *rq)
1431{ 1421{
1432 struct cfq_data *cfqd = q->elevator->elevator_data; 1422 struct cfq_data *cfqd = q->elevator->elevator_data;
1433 const int sync = rq_is_sync(rq);
1434 1423
1435 WARN_ON(!cfqd->rq_in_driver[sync]); 1424 WARN_ON(!cfqd->rq_in_driver);
1436 cfqd->rq_in_driver[sync]--; 1425 cfqd->rq_in_driver--;
1437 cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "deactivate rq, drv=%d", 1426 cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "deactivate rq, drv=%d",
1438 rq_in_driver(cfqd)); 1427 cfqd->rq_in_driver);
1439} 1428}
1440 1429
1441static void cfq_remove_request(struct request *rq) 1430static void cfq_remove_request(struct request *rq)
@@ -1673,16 +1662,7 @@ static inline sector_t cfq_dist_from_last(struct cfq_data *cfqd,
1673static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq, 1662static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1674 struct request *rq, bool for_preempt) 1663 struct request *rq, bool for_preempt)
1675{ 1664{
1676 sector_t sdist = cfqq->seek_mean; 1665 return cfq_dist_from_last(cfqd, rq) <= CFQQ_SEEK_THR;
1677
1678 if (!sample_valid(cfqq->seek_samples))
1679 sdist = CFQQ_SEEK_THR;
1680
1681 /* if seek_mean is big, using it as close criteria is meaningless */
1682 if (sdist > CFQQ_SEEK_THR && !for_preempt)
1683 sdist = CFQQ_SEEK_THR;
1684
1685 return cfq_dist_from_last(cfqd, rq) <= sdist;
1686} 1666}
1687 1667
1688static struct cfq_queue *cfqq_close(struct cfq_data *cfqd, 1668static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
@@ -1878,8 +1858,7 @@ static void cfq_dispatch_insert(struct request_queue *q, struct request *rq)
1878 cfqq->dispatched++; 1858 cfqq->dispatched++;
1879 elv_dispatch_sort(q, rq); 1859 elv_dispatch_sort(q, rq);
1880 1860
1881 if (cfq_cfqq_sync(cfqq)) 1861 cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]++;
1882 cfqd->sync_flight++;
1883 cfqq->nr_sectors += blk_rq_sectors(rq); 1862 cfqq->nr_sectors += blk_rq_sectors(rq);
1884} 1863}
1885 1864
@@ -2219,6 +2198,19 @@ static int cfq_forced_dispatch(struct cfq_data *cfqd)
2219 return dispatched; 2198 return dispatched;
2220} 2199}
2221 2200
2201static inline bool cfq_slice_used_soon(struct cfq_data *cfqd,
2202 struct cfq_queue *cfqq)
2203{
2204 /* the queue hasn't finished any request, can't estimate */
2205 if (cfq_cfqq_slice_new(cfqq))
2206 return 1;
2207 if (time_after(jiffies + cfqd->cfq_slice_idle * cfqq->dispatched,
2208 cfqq->slice_end))
2209 return 1;
2210
2211 return 0;
2212}
2213
2222static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq) 2214static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
2223{ 2215{
2224 unsigned int max_dispatch; 2216 unsigned int max_dispatch;
@@ -2226,16 +2218,16 @@ static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
2226 /* 2218 /*
2227 * Drain async requests before we start sync IO 2219 * Drain async requests before we start sync IO
2228 */ 2220 */
2229 if (cfq_should_idle(cfqd, cfqq) && cfqd->rq_in_driver[BLK_RW_ASYNC]) 2221 if (cfq_should_idle(cfqd, cfqq) && cfqd->rq_in_flight[BLK_RW_ASYNC])
2230 return false; 2222 return false;
2231 2223
2232 /* 2224 /*
2233 * If this is an async queue and we have sync IO in flight, let it wait 2225 * If this is an async queue and we have sync IO in flight, let it wait
2234 */ 2226 */
2235 if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq)) 2227 if (cfqd->rq_in_flight[BLK_RW_SYNC] && !cfq_cfqq_sync(cfqq))
2236 return false; 2228 return false;
2237 2229
2238 max_dispatch = cfqd->cfq_quantum; 2230 max_dispatch = max_t(unsigned int, cfqd->cfq_quantum / 2, 1);
2239 if (cfq_class_idle(cfqq)) 2231 if (cfq_class_idle(cfqq))
2240 max_dispatch = 1; 2232 max_dispatch = 1;
2241 2233
@@ -2252,13 +2244,22 @@ static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
2252 /* 2244 /*
2253 * We have other queues, don't allow more IO from this one 2245 * We have other queues, don't allow more IO from this one
2254 */ 2246 */
2255 if (cfqd->busy_queues > 1) 2247 if (cfqd->busy_queues > 1 && cfq_slice_used_soon(cfqd, cfqq))
2256 return false; 2248 return false;
2257 2249
2258 /* 2250 /*
2259 * Sole queue user, no limit 2251 * Sole queue user, no limit
2260 */ 2252 */
2261 max_dispatch = -1; 2253 if (cfqd->busy_queues == 1)
2254 max_dispatch = -1;
2255 else
2256 /*
2257 * Normally we start throttling cfqq when cfq_quantum/2
2258 * requests have been dispatched. But we can drive
2259 * deeper queue depths at the beginning of slice
2260 * subjected to upper limit of cfq_quantum.
2261 * */
2262 max_dispatch = cfqd->cfq_quantum;
2262 } 2263 }
2263 2264
2264 /* 2265 /*
@@ -2980,30 +2981,20 @@ static void
2980cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_queue *cfqq, 2981cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_queue *cfqq,
2981 struct request *rq) 2982 struct request *rq)
2982{ 2983{
2983 sector_t sdist; 2984 sector_t sdist = 0;
2984 u64 total; 2985 sector_t n_sec = blk_rq_sectors(rq);
2986 if (cfqq->last_request_pos) {
2987 if (cfqq->last_request_pos < blk_rq_pos(rq))
2988 sdist = blk_rq_pos(rq) - cfqq->last_request_pos;
2989 else
2990 sdist = cfqq->last_request_pos - blk_rq_pos(rq);
2991 }
2985 2992
2986 if (!cfqq->last_request_pos) 2993 cfqq->seek_history <<= 1;
2987 sdist = 0; 2994 if (blk_queue_nonrot(cfqd->queue))
2988 else if (cfqq->last_request_pos < blk_rq_pos(rq)) 2995 cfqq->seek_history |= (n_sec < CFQQ_SECT_THR_NONROT);
2989 sdist = blk_rq_pos(rq) - cfqq->last_request_pos;
2990 else 2996 else
2991 sdist = cfqq->last_request_pos - blk_rq_pos(rq); 2997 cfqq->seek_history |= (sdist > CFQQ_SEEK_THR);
2992
2993 /*
2994 * Don't allow the seek distance to get too large from the
2995 * odd fragment, pagein, etc
2996 */
2997 if (cfqq->seek_samples <= 60) /* second&third seek */
2998 sdist = min(sdist, (cfqq->seek_mean * 4) + 2*1024*1024);
2999 else
3000 sdist = min(sdist, (cfqq->seek_mean * 4) + 2*1024*64);
3001
3002 cfqq->seek_samples = (7*cfqq->seek_samples + 256) / 8;
3003 cfqq->seek_total = (7*cfqq->seek_total + (u64)256*sdist) / 8;
3004 total = cfqq->seek_total + (cfqq->seek_samples/2);
3005 do_div(total, cfqq->seek_samples);
3006 cfqq->seek_mean = (sector_t)total;
3007} 2998}
3008 2999
3009/* 3000/*
@@ -3028,8 +3019,7 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3028 cfq_mark_cfqq_deep(cfqq); 3019 cfq_mark_cfqq_deep(cfqq);
3029 3020
3030 if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle || 3021 if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle ||
3031 (!cfq_cfqq_deep(cfqq) && sample_valid(cfqq->seek_samples) 3022 (!cfq_cfqq_deep(cfqq) && CFQQ_SEEKY(cfqq)))
3032 && CFQQ_SEEKY(cfqq)))
3033 enable_idle = 0; 3023 enable_idle = 0;
3034 else if (sample_valid(cic->ttime_samples)) { 3024 else if (sample_valid(cic->ttime_samples)) {
3035 if (cic->ttime_mean > cfqd->cfq_slice_idle) 3025 if (cic->ttime_mean > cfqd->cfq_slice_idle)
@@ -3215,14 +3205,14 @@ static void cfq_update_hw_tag(struct cfq_data *cfqd)
3215{ 3205{
3216 struct cfq_queue *cfqq = cfqd->active_queue; 3206 struct cfq_queue *cfqq = cfqd->active_queue;
3217 3207
3218 if (rq_in_driver(cfqd) > cfqd->hw_tag_est_depth) 3208 if (cfqd->rq_in_driver > cfqd->hw_tag_est_depth)
3219 cfqd->hw_tag_est_depth = rq_in_driver(cfqd); 3209 cfqd->hw_tag_est_depth = cfqd->rq_in_driver;
3220 3210
3221 if (cfqd->hw_tag == 1) 3211 if (cfqd->hw_tag == 1)
3222 return; 3212 return;
3223 3213
3224 if (cfqd->rq_queued <= CFQ_HW_QUEUE_MIN && 3214 if (cfqd->rq_queued <= CFQ_HW_QUEUE_MIN &&
3225 rq_in_driver(cfqd) <= CFQ_HW_QUEUE_MIN) 3215 cfqd->rq_in_driver <= CFQ_HW_QUEUE_MIN)
3226 return; 3216 return;
3227 3217
3228 /* 3218 /*
@@ -3232,7 +3222,7 @@ static void cfq_update_hw_tag(struct cfq_data *cfqd)
3232 */ 3222 */
3233 if (cfqq && cfq_cfqq_idle_window(cfqq) && 3223 if (cfqq && cfq_cfqq_idle_window(cfqq) &&
3234 cfqq->dispatched + cfqq->queued[0] + cfqq->queued[1] < 3224 cfqq->dispatched + cfqq->queued[0] + cfqq->queued[1] <
3235 CFQ_HW_QUEUE_MIN && rq_in_driver(cfqd) < CFQ_HW_QUEUE_MIN) 3225 CFQ_HW_QUEUE_MIN && cfqd->rq_in_driver < CFQ_HW_QUEUE_MIN)
3236 return; 3226 return;
3237 3227
3238 if (cfqd->hw_tag_samples++ < 50) 3228 if (cfqd->hw_tag_samples++ < 50)
@@ -3285,13 +3275,12 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
3285 3275
3286 cfq_update_hw_tag(cfqd); 3276 cfq_update_hw_tag(cfqd);
3287 3277
3288 WARN_ON(!cfqd->rq_in_driver[sync]); 3278 WARN_ON(!cfqd->rq_in_driver);
3289 WARN_ON(!cfqq->dispatched); 3279 WARN_ON(!cfqq->dispatched);
3290 cfqd->rq_in_driver[sync]--; 3280 cfqd->rq_in_driver--;
3291 cfqq->dispatched--; 3281 cfqq->dispatched--;
3292 3282
3293 if (cfq_cfqq_sync(cfqq)) 3283 cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]--;
3294 cfqd->sync_flight--;
3295 3284
3296 if (sync) { 3285 if (sync) {
3297 RQ_CIC(rq)->last_end_request = now; 3286 RQ_CIC(rq)->last_end_request = now;
@@ -3345,7 +3334,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
3345 } 3334 }
3346 } 3335 }
3347 3336
3348 if (!rq_in_driver(cfqd)) 3337 if (!cfqd->rq_in_driver)
3349 cfq_schedule_dispatch(cfqd); 3338 cfq_schedule_dispatch(cfqd);
3350} 3339}
3351 3340
diff --git a/block/elevator.c b/block/elevator.c
index 9ad5ccc4c5ee..ee3a883840f2 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -474,6 +474,15 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
474 int ret; 474 int ret;
475 475
476 /* 476 /*
477 * Levels of merges:
478 * nomerges: No merges at all attempted
479 * noxmerges: Only simple one-hit cache try
480 * merges: All merge tries attempted
481 */
482 if (blk_queue_nomerges(q))
483 return ELEVATOR_NO_MERGE;
484
485 /*
477 * First try one-hit cache. 486 * First try one-hit cache.
478 */ 487 */
479 if (q->last_merge) { 488 if (q->last_merge) {
@@ -484,7 +493,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
484 } 493 }
485 } 494 }
486 495
487 if (blk_queue_nomerges(q)) 496 if (blk_queue_noxmerges(q))
488 return ELEVATOR_NO_MERGE; 497 return ELEVATOR_NO_MERGE;
489 498
490 /* 499 /*