Skip to contentSkip to conversation

detail in fs/block_dev.c

PATCH New christophe barbe 1 participant 1 message Mar 2, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 detail in fs/block_dev.c

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

Signature · 8 lines
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
block_dev.c renamed from block_dev.c.org +2 -5
@@ -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;