Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d84070ee0a433620c57e85dac7f82faaec5fbb3
Commit:     5d84070ee0a433620c57e85dac7f82faaec5fbb3
Parent:     482eb689169948e9f4966fbae6be4d6bc0bfa818
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 12:44:44 2008 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 10:04:46 2008 +0100

    __bio_clone: don't calculate hw/phys segment counts
    
    If the users sets a new ->bi_bdev on the bio after __bio_clone() has
    returned it, the "segment counts valid" flag still remains even though
    it may be different with the new target. So don't calculate segment
    counts in __bio_clone().
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 fs/bio.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index d59ddbf..242e409 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -248,11 +248,13 @@ inline int bio_hw_segments(struct request_queue *q, 
struct bio *bio)
  */
 void __bio_clone(struct bio *bio, struct bio *bio_src)
 {
-       struct request_queue *q = bdev_get_queue(bio_src->bi_bdev);
-
        memcpy(bio->bi_io_vec, bio_src->bi_io_vec,
                bio_src->bi_max_vecs * sizeof(struct bio_vec));
 
+       /*
+        * most users will be overriding ->bi_bdev with a new target,
+        * so we don't set nor calculate new physical/hw segment counts here
+        */
        bio->bi_sector = bio_src->bi_sector;
        bio->bi_bdev = bio_src->bi_bdev;
        bio->bi_flags |= 1 << BIO_CLONED;
@@ -260,8 +262,6 @@ void __bio_clone(struct bio *bio, struct bio *bio_src)
        bio->bi_vcnt = bio_src->bi_vcnt;
        bio->bi_size = bio_src->bi_size;
        bio->bi_idx = bio_src->bi_idx;
-       bio_phys_segments(q, bio);
-       bio_hw_segments(q, bio);
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to