From: Martin Dalecki <dalecki@evision-ventures.com>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: Pavel Machek <pavel@suse.cz>, Jens Axboe <axboe@suse.de>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: another IDE cleanup: kill duplicated code
Date: Tue, 12 Feb 2002 14:58:52 +0100 [thread overview]
Message-ID: <3C691F9C.10303@evision-ventures.com> (raw)
In-Reply-To: <20020211221102.GA131@elf.ucw.cz> <3C68F3F3.8030709@evision-ventures.com> <20020212132846.A7966@suse.cz> <3C690E56.3070606@evision-ventures.com> <20020212135701.A16420@suse.cz> <3C6915FC.2020707@evision-ventures.com> <20020212144300.A18431@suse.cz>
Vojtech Pavlik wrote:
>On Tue, Feb 12, 2002 at 02:17:48PM +0100, Martin Dalecki wrote:
>
>>So the conclusions is that not just the read_ahead array is bogous now.
>>The max_readahead array can be killed entierly from the kernel as well ;-).
>>
>>The answer is: I'm now confident that you can just remove all the
>>max_readahead initialization from the ide code.
>>
>
>Since I've come to the same conclusion, here is the patch. It removes
>read_ahead, max_readahead, BLKRAGET, BLKRASET, BLKFRAGET and BLKFRASET
>completely.
>
Welcome the the "Write Only Variable" haters club ;-).
Please note that the lvm code is playing mental with himself on the
lv_read_ahead struct member as well.
This member get's set saved preserved, but it's never used nowhere there:
./include/linux/lvm.h: uint lv_read_ahead;
./include/linux/lvm.h: uint32_t lv_read_ahead; /* HM */
>diff -urN linux-2.5.4/drivers/block/ll_rw_blk.c linux-2.5.4-readahead/drivers/block/ll_rw_blk.c
>--- linux-2.5.4/drivers/block/ll_rw_blk.c Thu Jan 31 16:45:20 2002
>+++ linux-2.5.4-readahead/drivers/block/ll_rw_blk.c Tue Feb 12 14:27:32 2002
>@@ -56,8 +56,6 @@
>
> /* This specifies how many sectors to read ahead on the disk. */
>
>-int read_ahead[MAX_BLKDEV];
>-
>
You did miss the comment by shooting above!
>diff -urN linux-2.5.4/include/linux/fs.h linux-2.5.4-readahead/include/linux/fs.h
>--- linux-2.5.4/include/linux/fs.h Tue Feb 12 12:22:54 2002
>+++ linux-2.5.4-readahead/include/linux/fs.h Tue Feb 12 14:32:32 2002
>@@ -173,10 +173,6 @@
> #define BLKRRPART _IO(0x12,95) /* re-read partition table */
> #define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
> #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
>-#define BLKRASET _IO(0x12,98) /* Set read ahead for block device */
>-#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
>-#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
>-#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
> #define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
> #define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
> #define BLKSSZGET _IO(0x12,104)/* get block device sector size */
>@@ -1490,8 +1486,6 @@
>
I would rather suggest to to #if 0 ... #endif instead with a note about
those values beeing no longer used.
>diff -urN linux-2.5.4/mm/filemap.c linux-2.5.4-readahead/mm/filemap.c
>--- linux-2.5.4/mm/filemap.c Tue Feb 12 12:22:54 2002
>+++ linux-2.5.4-readahead/mm/filemap.c Tue Feb 12 14:29:58 2002
>@@ -1131,13 +1131,6 @@
> * 64k if defined (4K page size assumed).
> */
>
>-static inline int get_max_readahead(struct inode * inode)
>-{
>- if (kdev_none(inode->i_dev) || !max_readahead[major(inode->i_dev)])
>- return MAX_READAHEAD;
>- return max_readahead[major(inode->i_dev)][minor(inode->i_dev)];
>-}
>-
> static void generic_file_readahead(int reada_ok,
> struct file * filp, struct inode * inode,
> struct page * page)
>@@ -1146,7 +1139,7 @@
> unsigned long index = page->index;
> unsigned long max_ahead, ahead;
> unsigned long raend;
>- int max_readahead = get_max_readahead(inode);
>+ int max_readahead = MAX_READAHEAD;
>
This wonders me a bit, why you didn't just propagate the constant deeper.
next prev parent reply other threads:[~2002-02-12 13:59 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-11 22:11 another IDE cleanup: kill duplicated code Pavel Machek
2002-02-12 10:52 ` Martin Dalecki
2002-02-12 12:28 ` Vojtech Pavlik
2002-02-12 12:45 ` Martin Dalecki
2002-02-12 12:57 ` Vojtech Pavlik
2002-02-12 13:17 ` Martin Dalecki
2002-02-12 13:43 ` Vojtech Pavlik
2002-02-12 13:58 ` Martin Dalecki [this message]
2002-02-12 14:42 ` Vojtech Pavlik
2002-02-12 15:23 ` Martin Dalecki
2002-02-12 15:28 ` Vojtech Pavlik
2002-02-12 15:35 ` Martin Dalecki
2002-02-12 16:56 ` Jens Axboe
2002-02-13 5:50 ` Andre Hedrick
2002-02-13 7:28 ` Vojtech Pavlik
2002-02-13 10:53 ` Martin Dalecki
2002-02-13 10:35 ` Martin Dalecki
2002-02-13 10:29 ` Andre Hedrick
2002-02-13 10:56 ` Pavel Machek
2002-02-13 11:11 ` Martin Dalecki
2002-02-13 11:25 ` Matthias Andree
2002-02-12 18:28 ` Andreas Dilger
2002-02-13 12:35 ` Martin Dalecki
2002-02-13 16:24 ` Andreas Dilger
2002-02-13 16:31 ` Martin Dalecki
2002-02-12 16:57 ` Jens Axboe
2002-02-13 5:46 ` Andre Hedrick
2002-02-13 6:42 ` Jens Axboe
2002-02-13 7:30 ` Andre Hedrick
2002-02-13 7:47 ` Jens Axboe
2002-02-13 7:44 ` Andre Hedrick
2002-02-13 7:58 ` Jens Axboe
2002-02-13 20:38 ` Rik van Riel
2002-02-13 11:01 ` Martin Dalecki
2002-02-13 11:03 ` Jens Axboe
2002-02-13 11:27 ` Vojtech Pavlik
2002-02-13 7:05 ` Vojtech Pavlik
2002-02-12 12:50 ` Martin Dalecki
2002-02-12 19:19 ` Roger Larsson
2002-02-13 10:56 ` Martin Dalecki
2002-02-12 20:03 ` Andrew Morton
2002-02-13 10:47 ` Martin Dalecki
2002-02-13 18:52 ` Andrew Morton
2002-02-14 10:04 ` Martin Dalecki
2002-02-14 10:19 ` Andrew Morton
2002-02-13 5:52 ` Andre Hedrick
2002-02-13 7:30 ` Vojtech Pavlik
2002-02-13 7:27 ` Andre Hedrick
2002-02-13 10:39 ` Vojtech Pavlik
2002-02-13 10:46 ` Andre Hedrick
2002-02-13 11:26 ` Vojtech Pavlik
2002-02-13 11:26 ` Andre Hedrick
2002-02-13 11:03 ` Daniel Egger
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=3C691F9C.10303@evision-ventures.com \
--to=dalecki@evision-ventures.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=vojtech@suse.cz \
/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 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.