NAME

puffs_suspend - puffs file system suspension and snapshotting

LIBRARY

SYNOPSIS



int puffs_fs_suspend(struct puffs_usermount *pu)

DESCRIPTION

The function puffs_fs_suspend() requests the kernel to suspend operations to the file system indicated by pu. There are several possible outcomes: nothing, an error or success. These will be indicated through the callback of the same name. The file system must set this callback if it wants to be notified of file system suspension. The interface call itself returns 0 on success or -1 on error and sets errno. In case an error is returned, the callback will never be called. However, the converse does not hold and the callback may never be called even if the library call is successful.

In case the kernel is successful to start suspending the file system, the callback is called with status PUFFS_SUSPEND START. The file system implementation may use this as a hint on how to handle following operations. Once the file system has successfully been suspended, the status PUFFS_SUSPEND_SUSPENDED will be delivered. In case there was an error while suspending, PUFFS_SUSPEND_ERROR is given. This effectively nullifies any PUFFS_SUSPEND_START given earlier. Operation will automatically resume after suspension and the status PUFFS_SUSPEND_RESUME is delivered to the callback. Error or success is always provided in case start is given.

The file system is supposed to do a file system specific snapshotting routine when it receives PUFFS_SUSPEND_SUSPENDED.

SEE ALSO

puffs(3), puffs_cc(3)

BUGS

Currently the implementation works only for single-threaded file systems which do not use puffs_cc.

File system data and metadata are not always totally correctly synchronized at suspend.