public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: christophe barbe <christophe.barbe@inup.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] detail in fs/block_dev.c
Date: Fri, 2 Mar 2001 18:21:35 +0100	[thread overview]
Message-ID: <20010302182135.B13539@pc8.inup.com> (raw)
In-Reply-To: <20010302181726.A13539@pc8.inup.com>
In-Reply-To: <20010302181726.A13539@pc8.inup.com>; from christophe.barbe@inup.com on ven, mar 02, 2001 at 18:17:26 +0100

[-- 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;

           reply	other threads:[~2001-03-02 17:21 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20010302181726.A13539@pc8.inup.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010302182135.B13539@pc8.inup.com \
    --to=christophe.barbe@inup.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox