Subject: VOP_FSYNC parameter extension
To: None <>
From: Frank van der Linden <>
List: tech-kern
Date: 12/10/1999 09:51:56
I'd like to add 2 parameters to the FSYNC VOP. Background: for NFSv3,
writing was optimized by allowing the client to do "unstable" writes
(i.e. the data may still be in the buffer cache of the server), and
"commit" the data later. Such a commit RPC specifies a range in
the file to be flushed. The spec says that all metadata associated
with this range should also be flushed.

There is currently no way to tell an FS to flush a range in a file.
The NFS server code simply calls VOP_FSYNC to sync the whole file.
This is clearly not optimal, and has been known for a few years, but
I never got around to fixing it.

So, I'd like to add to parameters to VOP_FSYNC: start (off_t) and end (off_t).
The FSYNC operation for any FS should, on an error-free return, have
flushed the range specified by these parameters. Note that this may
imply that the whole file has been flushed anyway, for filesystems
that cannot handle flushing ranges. The guarantee made by the call
is that at least the specified range has been flushed.

The other parameters of the call remain unchanged in their value
and meaning.

An "end" value of -1 means "the end of the file". So, specifing 0 and -1
means syncing the whole file.

- Frank

P.S. I am aware that commits could also be handled better in our client
     code, but that's a seperate issue.