Re: bdflush customization

Richard B. Johnson (root@chaos.analogic.com)
Wed, 8 Sep 1999 08:53:52 -0400 (EDT)


On Wed, 8 Sep 1999, Pascal Schmitt wrote:

> Hi,
>
> It is possible to customize the bdflush deamon in order to made it
> synchronizing one disk every 30sec and an another every days ? (without
> hacking a lot the kernel sources )
> Sounds strange, but on an embedded system I have a NAND Flash file
> system and a hard disk. NAND can't be synchronized as regularly as the
> hard disk because of the number of write limit. that's why the question.
>
> I'll appreciate any clue,advice or link.
>

Update just executes sync() at some interval. You can hack out a new
update daemon as:

int main(int unused, char *argv[])
{
if(fork()) return 0;
strcpy(argv[0], "bdflush");
for(;;)
{
sync();
sleep(30);
}
}

Now, the problem is with the flash file. You can hack the sources
../linux/fs/super.c, to sync your device only after each 'N' times
it's called. Unmounting a device will sync it, but it will take a
longer time than usual if it hasn't been synchronized recently.

Cheers,
Dick Johnson
**** FILE SYSTEM WAS MODIFIED ****
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

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