aboutsummaryrefslogtreecommitdiff
path: root/fs/bio.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-06-06 10:19:40 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-06-06 10:19:40 -0400
commita99bcec61adbe40892e285b6613adaca29f6ca93 (patch)
tree29c9e8ed98343ad3131aff28a8b8d81b8f26fda0 /fs/bio.c
parentc96da77dcbdad05e0d707f443328e708f7cb024a (diff)
parent563b3269570396946bc2b08e078c6556f9029a95 (diff)
Merge tag 'v3.2.19' into v3.2-rt
This is the 3.2.19 stable release
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bio.c b/fs/bio.c
index b1fe82cf88cf..4fc4dbb079a9 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -507,11 +507,12 @@ int bio_get_nr_vecs(struct block_device *bdev)
struct request_queue *q = bdev_get_queue(bdev);
int nr_pages;
- nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT;
- if (nr_pages > queue_max_segments(q))
- nr_pages = queue_max_segments(q);
+ nr_pages = min_t(unsigned,
+ queue_max_segments(q),
+ queue_max_sectors(q) / (PAGE_SIZE >> 9) + 1);
+
+ return min_t(unsigned, nr_pages, BIO_MAX_PAGES);
- return nr_pages;
}
EXPORT_SYMBOL(bio_get_nr_vecs);