Ok, thanks for the clarification. I think the behavior is fine - it is not difficult to track the number of open / release events.
I think the problem may be that I misunderstood the comments in fuse.h:
* - release() is called when an open file has:
* 1) all file descriptors closed
* 2) all memory mappings unmapped
* This call need only be implemented if this information is required,
* otherwise set this function to NULL.
The "all file descriptors closed" is what threw me. After all, the user-level filesystem can't match up particular open() calls with particular release() calls, can it? So, I can't drop information about the state of an open file until *all* file descriptors are closed -- meaning the release count equals the open event count.
On Thu, 2004-05-13 at 13:00, Miklos Szeredi wrote:
It has always been like this. The open / release calls correspond to
actual file opens / releases. The release is called when there are no
more refernces to the file, i.e. on the last close() or munmap().