public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] detail in fs/block_dev.c
       [not found] <20010302181726.A13539@pc8.inup.com>
@ 2001-03-02 17:21 ` christophe barbe
  0 siblings, 0 replies; only message in thread
From: christophe barbe @ 2001-03-02 17:21 UTC (permalink / raw)
  To: linux-kernel

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

in fs/block_dev.c block_read() function (in 2.2 and 2.4 series)

rblocks = blocks = (left + offset + blocksize - 1) >> blocksize_bits;
bhb = bhe = buflist;
if (filp->f_reada) {
	if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
		blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
	if (rblocks > blocks)
		blocks = rblocks;

The second test is false in all case and there's no concequences because the rblocks variable is never used.

So I've joined a patch (ok for 2.2.17 and 2.4.2) to remove rblocks.

Christophe

-- 
Christophe Barbé
Software Engineer
Lineo High Availability Group
42-46, rue Médéric
92110 Clichy - France
phone (33).1.41.40.02.12
fax (33).1.41.40.02.01
www.lineo.com

[-- Attachment #2: block_dev.patch --]
[-- Type: application/octet-stream, Size: 860 bytes --]

--- fs/block_dev.c.org	Fri Mar  2 18:16:04 2001
+++ fs/block_dev.c	Fri Mar  2 18:16:43 2001
@@ -163,7 +163,7 @@
 	loff_t offset;
 	ssize_t blocksize;
 	ssize_t blocksize_bits, i;
-	size_t blocks, rblocks, left;
+	size_t blocks, left;
 	int bhrequest, uptodate;
 	struct buffer_head ** bhb, ** bhe;
 	struct buffer_head * buflist[NBUF];
@@ -205,14 +205,11 @@
 	block = offset >> blocksize_bits;
 	offset &= blocksize-1;
 	size >>= blocksize_bits;
-	rblocks = blocks = (left + offset + blocksize - 1) >> blocksize_bits;
+	blocks = (left + offset + blocksize - 1) >> blocksize_bits;
 	bhb = bhe = buflist;
 	if (filp->f_reada) {
 	        if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
 			blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
-		if (rblocks > blocks)
-			blocks = rblocks;
-		
 	}
 	if (block + blocks > size) {
 		blocks = size - block;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-03-02 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20010302181726.A13539@pc8.inup.com>
2001-03-02 17:21 ` [PATCH] detail in fs/block_dev.c christophe barbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox