Re: IDE crash...

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <fujita.tomonori@...>, <linux-kernel@...>
Date: Tuesday, October 23, 2007 - 3:23 am

On Tue, Oct 23 2007, David Miller wrote:

That should work - once you verify that, would you mind testing this one
as well? Thanks!

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 61c2e39..290836f 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1352,7 +1352,7 @@ new_segment:
 			if (!sg)
 				sg = sglist;
 			else
-				sg = sg_next(sg);
+				sg = sg_next_force(sg);
 
 			sg_dma_len(sg) = 0;
 			sg_dma_address(sg) = 0;
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 42daf5e..a98a2ee 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -99,6 +99,22 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg)
 	return sg;
 }
 
+/**
+ * sg_next_force - return the next scatterlist entry in a list
+ * @sg:		   The current sg entry
+ *
+ * Description:
+ *   Must only be used when more entries beyond this one is known to exist,
+ *   as it clears the termination bit. Useful to avoid adding a full sg
+ *   table init on every mapping.
+ *
+ **/
+static inline struct scatterlist *sg_next_force(struct scatterlist *sg)
+{
+	sg->page_link &= ~0x02;
+	return sg_next(sg);
+}
+
 /*
  * Loop over each sg element, following the pointer to a new list if necessary
  */

-- 
Jens Axboe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
IDE crash..., David Miller, (Tue Oct 23, 2:50 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 3:02 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 3:09 am)
Re: IDE crash..., FUJITA Tomonori, (Tue Oct 23, 3:14 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 3:23 am)
Re: IDE crash..., David Miller, (Tue Oct 23, 3:18 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 3:23 am)
Re: IDE crash..., David Miller, (Tue Oct 23, 3:43 am)
Re: IDE crash..., FUJITA Tomonori, (Tue Oct 23, 6:52 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 6:57 am)
Re: IDE crash..., David Miller, (Tue Oct 23, 5:18 pm)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 5:44 pm)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 6:58 am)
Re: IDE crash..., FUJITA Tomonori, (Tue Oct 23, 7:10 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 7:43 am)
Re: IDE crash..., Jens Axboe, (Tue Oct 23, 3:45 am)
Re: IDE crash..., John Stoffel, (Tue Oct 23, 11:10 am)
Re: IDE crash..., Jens Axboe, (Wed Oct 24, 2:49 am)
Re: IDE crash..., John Stoffel, (Wed Oct 24, 12:27 pm)
Re: IDE crash..., Jens Axboe, (Wed Oct 24, 2:10 pm)