2001-02-06 10:33:37 +00:00
|
|
|
.\" -*- nroff -*-
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2000 Boris Popov
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2001-02-06 15:07:35 +00:00
|
|
|
.Dd September 10, 2000
|
2001-02-06 10:33:37 +00:00
|
|
|
.Os
|
|
|
|
.Dt VOP_CREATEVOBJECT 9
|
|
|
|
.Sh NAME
|
|
|
|
.Nm VOP_CREATEVOBJECT ,
|
|
|
|
.Nm VOP_DESTROYVOBJECT ,
|
|
|
|
.Nm VOP_GETVOBJECT
|
|
|
|
.Nd VM object interaction
|
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/param.h
|
|
|
|
.In sys/vnode.h
|
2001-02-06 10:33:37 +00:00
|
|
|
.Ft int
|
2001-11-20 18:19:19 +00:00
|
|
|
.Fn VOP_CREATEVOBJECT "struct vnode *vp" "struct ucred *cred" "struct thread *td"
|
2001-02-06 10:33:37 +00:00
|
|
|
.Ft int
|
|
|
|
.Fn VOP_DESTROYVOBJECT "struct vnode *vp"
|
|
|
|
.Ft int
|
|
|
|
.Fn VOP_GETVOBJECT "struct vnode *vp" "struct vm_object **objpp"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
These calls are used to control the association of a VM object
|
|
|
|
with a particular vnode.
|
|
|
|
.Pp
|
|
|
|
The arguments specific to these functions are:
|
|
|
|
.Bl -tag -width objpp
|
2001-02-06 15:07:35 +00:00
|
|
|
.It Fa vp
|
2001-02-06 10:33:37 +00:00
|
|
|
the vnode of the file
|
2001-02-06 15:07:35 +00:00
|
|
|
.It Fa objpp
|
2001-02-06 10:33:37 +00:00
|
|
|
the VM object being returned, or
|
|
|
|
.Dv NULL
|
|
|
|
if the caller wants to test for the existence
|
|
|
|
of the VM object).
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Xr VFS 9
|
|
|
|
invokes
|
|
|
|
.Fn VOP_CREATEVOBJECT
|
|
|
|
when it needs to create a VM object for the given
|
|
|
|
.Xr vnode 9 .
|
|
|
|
Filesystem code may pass this call down to the underlying filesystem.
|
|
|
|
This VOP can be called multiple times,
|
|
|
|
and filesystem code should ignore any additional calls,
|
|
|
|
exiting with a zero return code.
|
|
|
|
.Pp
|
|
|
|
.Fn VOP_DESTROYVOBJECT
|
|
|
|
is called when a
|
|
|
|
.Xr vnode 9
|
|
|
|
is recycled.
|
|
|
|
.Pp
|
|
|
|
.Fn VOP_GETVOBJECT
|
|
|
|
should be used by all kernel code to get a VM object.
|
|
|
|
.\" XXX What is the next sentence trying to tell people?
|
|
|
|
The returned VM object may belong to a different filesystem in the case
|
|
|
|
of stacked mounts.
|
|
|
|
.Pp
|
|
|
|
.Xr 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 .
|
|
|
|
.Pp
|
2001-02-06 15:07:35 +00:00
|
|
|
.Em Note :
|
2001-02-06 10:33:37 +00:00
|
|
|
a
|
|
|
|
.Xr vnode 9
|
|
|
|
should be locked on entry and must be left locked on exit.
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
The
|
|
|
|
.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.
|
|
|
|
.Sh EXAMPLES
|
|
|
|
.\" XXX Why is this code here when it does not use the functions
|
|
|
|
.\" described in this manual page?
|
2001-02-06 15:07:35 +00:00
|
|
|
By default, filesystems leave VM object handling to the
|
|
|
|
.Fn vop_std*
|
|
|
|
functions.
|
2001-02-06 10:33:37 +00:00
|
|
|
.Sh SEE ALSO
|
2001-07-06 16:46:48 +00:00
|
|
|
.Xr vnode 9 ,
|
2001-02-06 10:33:37 +00:00
|
|
|
.Xr VOP_GETPAGES 9 ,
|
2001-07-06 16:46:48 +00:00
|
|
|
.Xr VOP_PUTPAGES 9
|
2001-02-06 10:33:37 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
This man page was written by
|
|
|
|
.An Boris Popov .
|