Check out the new USENIX Web site. next up previous
Next: write(2) Up: Behavior of typical operations Previous: Behavior of typical operations

read(2)

The read(2) operation is intercepted so that an attempt to read a non-resident portion of a file is blocked until either the data are restored, or the restoration fails. A failed restoration returns an EIO error to the calling process.

The behavior of the restoration-checking routine is fairly simple. If no restoration is in progress, a message is sent to the dmfsd daemon requesting a restore. Then, if the operation was initiated by the NFS server subsystem6, the EAGAIN error is returned. For an NFSv3 mount, the NFS subsystem will return the NFSERR_TRYLATER error code7.

Then the routine enters a loop. It flags that it is waiting, unlocks the vnode, and sleeps. The sleep is interruptible, and if it is interrupted the system call will be retried. This behavior permits users to abort a process waiting for a restoration.

Upon re-awaking, the vnode is re-locked and the file state is re-examined. If the restoration failed, EIO is returned. If the blocked read can now progress, it is passed down to the underlying layer.

For all read operations on nodes with valid DMFS metadata, the completion of the read operation is noted in the atime metadata field.


next up previous
Next: write(2) Up: Behavior of typical operations Previous: Behavior of typical operations
Bill Studenmund
2000-04-24