Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7aeacf982203fb4dea2f3434eefdc268cfd5d6d9
Commit:     7aeacf982203fb4dea2f3434eefdc268cfd5d6d9
Parent:     ad0d4083e65d9f223275adbfb9a7927e2120dc6c
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 09:49:25 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Oct 23 09:49:25 2007 +0200

    [BLOCK] blk_rq_map_sg: force clear termination bit
    
    Since blk_rq_map_sg() sets the termination bit at the end of the sg
    table, we could see it prematurely on the next mapping unless we
    force drivers to do a full sg_init_table() prior to each mapping. So
    force clear the termination bit to avoid having to put that clear in
    the driver for every mapping.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/ll_rw_blk.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index fb8fb88..de5ba47 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1351,8 +1351,20 @@ int blk_rq_map_sg(struct request_queue *q, struct 
request *rq,
 new_segment:
                        if (!sg)
                                sg = sglist;
-                       else
+                       else {
+                               /*
+                                * If the driver previously mapped a shorter
+                                * list, we could see a termination bit
+                                * prematurely unless it fully inits the sg
+                                * table on each mapping. We KNOW that there
+                                * must be more entries here or the driver
+                                * would be buggy, so force clear the
+                                * termination bit to avoid doing a full
+                                * sg_init_table() in drivers for each command.
+                                */
+                               sg->page_link &= ~0x02;
                                sg = sg_next(sg);
+                       }
 
                        sg_set_page(sg, bvec->bv_page);
                        sg->length = nbytes;
-
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