block: Consolidate phys_segment and hw_segment limits
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / bio.c
index 88094afc29ea38c13906d861ca9bb7dd67c463a2..dc17afd672e354810d4b7b2d54e21d466bf8cca8 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -507,10 +507,8 @@ int bio_get_nr_vecs(struct block_device *bdev)
        int nr_pages;
 
        nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       if (nr_pages > queue_max_phys_segments(q))
-               nr_pages = queue_max_phys_segments(q);
-       if (nr_pages > queue_max_hw_segments(q))
-               nr_pages = queue_max_hw_segments(q);
+       if (nr_pages > queue_max_segments(q))
+               nr_pages = queue_max_segments(q);
 
        return nr_pages;
 }
@@ -575,8 +573,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page
         * make this too complex.
         */
 
-       while (bio->bi_phys_segments >= queue_max_phys_segments(q)
-              || bio->bi_phys_segments >= queue_max_hw_segments(q)) {
+       while (bio->bi_phys_segments >= queue_max_segments(q)) {
 
                if (retried_segments)
                        return 0;