Other AliasVOP_DESTROYVOBJECT, VOP_GETVOBJECT
SYNOPSISIn sys/param.h In sys/vnode.h Ft int Fn VOP_CREATEVOBJECT struct vnode *vp struct ucred *cred struct thread *td Ft int Fn VOP_DESTROYVOBJECT struct vnode *vp Ft int Fn VOP_GETVOBJECT struct vnode *vp struct vm_object **objpp
DESCRIPTIONThese calls are used to control the association of a VM object with a particular vnode.
The arguments specific to these functions are:
- Fa vp
- The vnode of the file.
- Fa objpp
- The VM object being returned, or NULL if the caller wants to test for the existence of the VM object).
VFS(9) invokes Fn VOP_CREATEVOBJECT when it needs to create a VM object for the given vnode(9). File system code may pass this call down to the underlying file system. This VOP can be called multiple times, and file system code should ignore any additional calls, exiting with a zero return code.
Fn VOP_DESTROYVOBJECT is called when a vnode(9) is recycled.
Fn VOP_GETVOBJECT should be used by all kernel code to get a VM object. The returned VM object may belong to a different file system in the case of stacked mounts.
VFS(9) has three functions which perform standard operations by creating and destroying VM objects. These functions are: Fn vop_stdcreatevobject , Fn vop_stddestroyvobject and Fn vop_stdgetvobject .
Note a vnode(9) should be locked on entry and must be left locked on exit.
RETURN VALUESThe Fn VOP_CREATEVOBJECT , Fn VOP_DESTROYVOBJECT and Fn VOP_GETVOBJECT functions return zero on success, or a non-zero value on failure. Zero is returned on success, otherwise an error is returned.
EXAMPLESBy default, file systems leave VM object handling to the Fn vop_std* functions.
AUTHORSThis manual page was written by An Boris Popov .