All of lore.kernel.org
 help / color / mirror / Atom feed
* [BLOCK] phys_contig implies hw_contig
@ 2003-11-01  2:31 Herbert Xu
  2003-11-02  4:45 ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2003-11-01  2:31 UTC (permalink / raw)
  To: axboe, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

Hi:

In ll_merge_requests_fn, it is checking blk_hw_contig_segments even if
blk_phys_contig_segments succeeds.  This means that it may cause two
physically contiguous segments to be separated because the hw check
fails.

This patch fixes that.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1130 bytes --]

Index: kernel-source-2.5/drivers/block/ll_rw_blk.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/block/ll_rw_blk.c,v
retrieving revision 1.9
diff -u -r1.9 ll_rw_blk.c
--- kernel-source-2.5/drivers/block/ll_rw_blk.c	11 Oct 2003 06:29:20 -0000	1.9
+++ kernel-source-2.5/drivers/block/ll_rw_blk.c	1 Nov 2003 02:24:52 -0000
@@ -1046,16 +1046,16 @@
 		return 0;
 
 	total_phys_segments = req->nr_phys_segments + next->nr_phys_segments;
-	if (blk_phys_contig_segment(q, req->biotail, next->bio))
+	total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
+
+	if (blk_phys_contig_segment(q, req->biotail, next->bio)) {
 		total_phys_segments--;
+		total_hw_segments--;
+	} else if (blk_hw_contig_segment(q, req->biotail, next->bio))
+		total_hw_segments--;
 
 	if (total_phys_segments > q->max_phys_segments)
 		return 0;
-
-	total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
-	if (blk_hw_contig_segment(q, req->biotail, next->bio))
-		total_hw_segments--;
-
 	if (total_hw_segments > q->max_hw_segments)
 		return 0;
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-03 22:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-01  2:31 [BLOCK] phys_contig implies hw_contig Herbert Xu
2003-11-02  4:45 ` David S. Miller
2003-11-02  4:47   ` Herbert Xu
2003-11-02 22:10     ` Herbert Xu
2003-11-03 22:40       ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.