[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vim file write mode on journaling fs.



On Sat, Aug 11, 2001 at 08:48:01PM +0200, Bram Moolenaar wrote:
> What tools do I have that indicate to the FS how it should handle the data I
> have written?  Can I somehow tell it to flush my data soon, but not as drastic
> as syncing?

You could use fsync before the close. Then the write will be async, but at
the end there is a flush forced. This should also give you efficient 
extent allocation on XFS. For ext2 you should also fdatasync the directory
to make sure that the filename really has reached disk and won't hit
lost+found.

BTW while at it you could also make vim use rename+unlink of the old file 
instead of O_TRUNC for file writing,
then it would do COW in hardlinked trees, not requiring me to keep a clumpsy
wrapper around for that.

-Andi