aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 17376d86f412..e1f922184b45 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -506,10 +506,8 @@ int bio_get_nr_vecs(struct block_device *bdev)
506 int nr_pages; 506 int nr_pages;
507 507
508 nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT; 508 nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT;
509 if (nr_pages > queue_max_phys_segments(q)) 509 if (nr_pages > queue_max_segments(q))
510 nr_pages = queue_max_phys_segments(q); 510 nr_pages = queue_max_segments(q);
511 if (nr_pages > queue_max_hw_segments(q))
512 nr_pages = queue_max_hw_segments(q);
513 511
514 return nr_pages; 512 return nr_pages;
515} 513}
@@ -574,8 +572,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page
574 * make this too complex. 572 * make this too complex.
575 */ 573 */
576 574
577 while (bio->bi_phys_segments >= queue_max_phys_segments(q) 575 while (bio->bi_phys_segments >= queue_max_segments(q)) {
578 || bio->bi_phys_segments >= queue_max_hw_segments(q)) {
579 576
580 if (retried_segments) 577 if (retried_segments)
581 return 0; 578 return 0;