Re: another IDE cleanup: kill duplicated code

From: Vojtech Pavlik (vojtech@suse.cz)
Date: Tue Feb 12 2002 - 09:42:51 EST


On Tue, Feb 12, 2002 at 02:58:52PM +0100, Martin Dalecki wrote:

> 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 */

The later (lv_disk_t) struct isn't used anywhere in the kernel -
probably defined for userspace only? That's weird! And also many other
structs in lvm.h are nowhere to be found used. Guess we could swipe them
out as well.

The first lv_read_ahead (in lv_t) removed. And references to it as well.

> > /* This specifies how many sectors to read ahead on the disk. */
> >
> >-int read_ahead[MAX_BLKDEV];
> >-
> >
>
> You did miss the comment by shooting above!

Second shot right on target!

> >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
> >-#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 */
>
> I would rather suggest to to #if 0 ... #endif instead with a note about
> those values beeing no longer used.

Ok, makes sense.

> >- 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.

I was too hasty probably. Done now.

Patch v3 attached.

-- 
Vojtech Pavlik
SuSE Labs


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:49 EST