diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 12:00:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 12:00:29 -0500 |
commit | b1bf9368407ae7e89d8a005bb40beb70a41df539 (patch) | |
tree | 3815c8aab19c6c186736673c624fef5f3faab716 /fs/bio.c | |
parent | 524df55725217b13d5a232fb5badb5846418ea0e (diff) | |
parent | 4671a1322052425afa38fcb7980d2fd2bb0fc99b (diff) |
Merge branch 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits)
block: don't access jiffies when initialising io_context
cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds
block: fix for "Consolidate phys_segment and hw_segment limits"
cfq-iosched: quantum check tweak
blktrace: perform cleanup after setup error
blkdev: fix merge_bvec_fn return value checks
cfq-iosched: requests "in flight" vs "in driver" clarification
cciss: Fix problem with scatter gather elements in the scsi half of the driver
cciss: eliminate unnecessary pointer use in cciss scsi code
cciss: do not use void pointer for scsi hba data
cciss: factor out scatter gather chain block mapping code
cciss: fix scatter gather chain block dma direction kludge
cciss: simplify scatter gather code
cciss: factor out scatter gather chain block allocation and freeing
cciss: detect bad alignment of scsi commands at build time
cciss: clarify command list padding calculation
cfq-iosched: rethink seeky detection for SSDs
cfq-iosched: rework seeky detection
block: remove padding from io_context on 64bit builds
block: Consolidate phys_segment and hw_segment limits
...
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -507,10 +507,8 @@ int bio_get_nr_vecs(struct block_device *bdev) | |||
507 | int nr_pages; | 507 | int nr_pages; |
508 | 508 | ||
509 | nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT; | 509 | nr_pages = ((queue_max_sectors(q) << 9) + PAGE_SIZE - 1) >> PAGE_SHIFT; |
510 | if (nr_pages > queue_max_phys_segments(q)) | 510 | if (nr_pages > queue_max_segments(q)) |
511 | nr_pages = queue_max_phys_segments(q); | 511 | nr_pages = queue_max_segments(q); |
512 | if (nr_pages > queue_max_hw_segments(q)) | ||
513 | nr_pages = queue_max_hw_segments(q); | ||
514 | 512 | ||
515 | return nr_pages; | 513 | return nr_pages; |
516 | } | 514 | } |
@@ -557,7 +555,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page | |||
557 | .bi_rw = bio->bi_rw, | 555 | .bi_rw = bio->bi_rw, |
558 | }; | 556 | }; |
559 | 557 | ||
560 | if (q->merge_bvec_fn(q, &bvm, prev) < len) { | 558 | if (q->merge_bvec_fn(q, &bvm, prev) != prev->bv_len) { |
561 | prev->bv_len -= len; | 559 | prev->bv_len -= len; |
562 | return 0; | 560 | return 0; |
563 | } | 561 | } |
@@ -575,8 +573,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page | |||
575 | * make this too complex. | 573 | * make this too complex. |
576 | */ | 574 | */ |
577 | 575 | ||
578 | while (bio->bi_phys_segments >= queue_max_phys_segments(q) | 576 | while (bio->bi_phys_segments >= queue_max_segments(q)) { |
579 | || bio->bi_phys_segments >= queue_max_hw_segments(q)) { | ||
580 | 577 | ||
581 | if (retried_segments) | 578 | if (retried_segments) |
582 | return 0; | 579 | return 0; |
@@ -611,7 +608,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page | |||
611 | * merge_bvec_fn() returns number of bytes it can accept | 608 | * merge_bvec_fn() returns number of bytes it can accept |
612 | * at this offset | 609 | * at this offset |
613 | */ | 610 | */ |
614 | if (q->merge_bvec_fn(q, &bvm, bvec) < len) { | 611 | if (q->merge_bvec_fn(q, &bvm, bvec) != bvec->bv_len) { |
615 | bvec->bv_page = NULL; | 612 | bvec->bv_page = NULL; |
616 | bvec->bv_len = 0; | 613 | bvec->bv_len = 0; |
617 | bvec->bv_offset = 0; | 614 | bvec->bv_offset = 0; |