Re: fsync(2) weirdness

Gordon Oliver (gordo@telsur.cl)
Fri, 3 Oct 1997 15:11:49 -0400 (CST)


...Scott Laird says...:
> How hard would it be to do something like this inside ext2_sync_file?
>
> if(big_file) {
> scan the buffer cache and flush the ones for this inode (fsync_dev?);

There seems to be no easy way to go from buffer -> inode... Does anyone
else know of a way? it would be handy for this case. Otherwise you have
to write all the dirty buffers (on the device), which can hurt on a busy
system... this would work to the extent that file_fsync (fsync_dev) will
work.

<snip>

> Define big_file something like
>
> (number of blocks in file > number of blocks in kernel buffers)

prolly smaller, but that is the idea. Ideally, it would use some threshold
having to do with the number of dirty blocks.

---------------------------------------------------------------
Gordon Oliver (gordo@telsur.cl) Independent Consultant
... Available for consulting on Linux ...