From: Miklos S. <mi...@sz...> - 2004-12-06 15:56:07
|
> It seems that the structure filp has the reference > count: > filp->f_count > > So could this not be used to inform the user if this > is the final flush on a file? Yes, but only if mmap() is disabled, since it can also hold a reference to the file. However I do think that a cleaner aproach is to treat all flush-es equally. A flush-write-flush sequence will be very rare so it's not a performance problem. And you can keep track of the file descriptor (library API in CVS has support for this), to prevent duplicating files by overwriting the old copy with the new on a later flush of the same file. How does that sound? Miklos |