Add manpages describing various vfs and vm APIs.

Submitted by: Chad David <davidc@acns.ab.ca>
This commit is contained in:
Alfred Perlstein 2001-12-02 02:13:35 +00:00
parent d0b8d0fdfc
commit 2164257702
10 changed files with 701 additions and 6 deletions

View File

@ -40,6 +40,7 @@ MAN= BUF_LOCK.9 BUF_LOCKFREE.9 BUF_LOCKINIT.9 BUF_REFCNT.9 \
extattr.9 \
fetch.9 \
get_cyclecounter.9 \
getnewvnode.9 \
groupmember.9 \
ifnet.9 inittodr.9 intro.9 ithread.9 \
kernacc.9 kobj.9 kthread.9 ktr.9 \
@ -58,14 +59,15 @@ MAN= BUF_LOCK.9 BUF_LOCKFREE.9 BUF_LOCKINIT.9 BUF_REFCNT.9 \
taskqueue.9 time.9 timeout.9 tvtohz.9 \
ucred.9 uidinfo.9 uio.9 \
vaccess.9 vaccess_acl_posix1e.9 \
vcount.9 vfs_busy.9 vfs_mount.9 vfs_unbusy.9 \
vfs_unmountall.9 vget.9 vinvalbuf.9 \
vm_page_alloc.9 vm_page_cache.9 \
vm_page_copy.9 vm_page_deactivate.9 \
vm_page_flag.9 vm_page_free.9 vm_page_hold.9 \
vcount.9 vfs_busy.9 vfs_mount.9 vfs_timestamp.9 vfs_unbusy.9 \
vfs_unmountall.9 vget.9 vgone.9 vhold.9 vinvalbuf.9 \
vflush.9 \
vm_page_alloc.9 vm_page_bits.9 vm_page_cache.9 \
vm_page_copy.9 vm_page_deactivate.9 vm_page_dontneed.9 \
vm_page_flag.9 vm_page_free.9 vm_page_grab.9 vm_page_hold.9 \
vm_page_insert.9 vm_page_io.9 vm_page_lookup.9 \
vm_page_protect.9 vm_page_rename.9 \
vm_page_sleep_busy.9 vm_page_wakeup.9 \
vm_page_sleep_busy.9 vm_page_unmanage.9 vm_page_wakeup.9 \
vm_page_wire.9 vm_page_zero_fill.9 vm_set_page_size.9 \
vn_isdisk.9 vnode.9 vput.9 vref.9 vrele.9 \
vslock.9 \
@ -187,6 +189,16 @@ MLINKS+=timeout.9 callout_stop.9 timeout.9 callout_reset.9
MLINKS+=uidinfo.9 uihashinit.9 uidinfo.9 uifind.9
MLINKS+=uidinfo.9 uihold.9 uidinfo.9 uifree.9
MLINKS+=uio.9 uiomove.9
MLINKS+=vgone.9 vgonel.9
MLINKS+=vhold.9 vdrop.9
MLINKS+=vm_page_bits.9 vm_page_set_validclean.9
MLINKS+=vm_page_bits.9 vm_page_clear_dirty.9
MLINKS+=vm_page_bits.9 vm_page_set_invalid.9
MLINKS+=vm_page_bits.9 vm_page_zero_invalid.9
MLINKS+=vm_page_bits.9 vm_page_is_valid.9
MLINKS+=vm_page_bits.9 vm_page_test_dirty.9
MLINKS+=vm_page_bits.9 vm_page_dirty.9
MLINKS+=vm_page_bits.9 vm_page_undirty.9
MLINKS+=vm_page_flag.9 vm_page_flag_clear.9 vm_page_flag.9 vm_page_flag_set.9
MLINKS+=vm_page_free.9 vm_page_free_toq.9
MLINKS+=vm_page_free.9 vm_page_free_zero.9

View File

@ -0,0 +1,68 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd November 21, 2001
.Dt GETNEWVNODE 9
.Os
.Sh NAME
.Nm getnewvnode
.Nd "get a new vnode"
.Sh SYNOPSIS
.In sys/param.h
.In sys/vnode.h
.In sys/mount.h
.Ft int
.Fn getnewvnode "enum vtagtype tag" "struct mount *mp" "vop_t **vops" "struct vnode **vpp"
.Sh DESCRIPTION
The
.Fn getnewvnode
function initializes a new vnode, assigning it the vnode operations passed in
.Fa vops .
The vnode is either freshly allocated, or taken from the head of the
free list depending on the number of vnodes already in the system.
.Pp
The arguments to
.Fn getnewvnode
are:
.Bl -tag -width ".Fa vops"
.It Fa tag
The filesystem type.
.It Fa mp
The mount point to add the new vnode to.
.It Fa vops
The vnode operations to assign to the new vnode.
.It Fa vpp
Points to the new vnode upon successful completion.
.El
.Sh RETURN VALUES
.Fn getnewvnode
returns 0 on success.
There are currently no failure conditions - that do not result in a panic.
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

76
share/man/man9/vflush.9 Normal file
View File

@ -0,0 +1,76 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd November 21, 2001
.Dt VFLUSH 9
.Os
.Sh NAME
.Nm vflush
.Nd "flush vnodes for a mount point"
.Sh SYNOPSIS
.In sys/param.h
.In sys/mount.h
.Ft int
.Fn vflush "struct mount *mp" "int rootrefs" "int flags"
.Sh DESCRIPTION
The
.Fn vflush
function removes any vnodes in the vnode table that belong to the given mount
structure.
.Pp
Its arguments are:
.Bl -tag -width ".Fa rootrefs"
.It Fa mp
The mount point whose vnodes should be removed.
.It Fa rootrefs
The number of references expected on the root vnode.
.Fn vrele
will be invoked on the root vnode
.Fa rootrefs
times.
.It Fa flags
The flags indicating how vnodes should be handled.
.Bl -tag -width ".Dv WRITECLOSE"
.It Dv FORCECLOSE
If set busy vnodes will be forcibly closed.
.It Dv SKIPSYSTEM
If set vnodes with the VSYSTEM flag set will be skipped.
.It Dv WRITECLOSE
If set only regular files currently opened for writing will be removed.
.El
.El
.Sh RETURN VALUES
A value of 0 is returned if the flush is successful; otherwise,
.Dv EBUSY
will be returned.
.Sh SEE ALSO
.Xr vgone 9 ,
.Xr vgonel 9
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

View File

@ -0,0 +1,57 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd November 21, 2001
.Dt VFS_TIMESTAMP 9
.Os
.Sh NAME
.Nm vfs_timestamp
.Nd "generate current timestamp"
.Sh SYNOPSIS
.In sys/param.h
.Ft void
.Fn vfs_timespec "struct timespec *tsp"
.Sh DESCRIPTION
The
.Fn vfs_timespec
function fills in
.Fa tsp
with the current time.
.Pp
The precision is based on the value of the
.Dv vfs.timestamp_precision
sysctl variable:
.Bd -literal
0 = seconds only; nanoseconds are zeroed.
1 = seconds and nanoseconds, accurate within 1/HZ.
2 = seconds and nanoseconds, trucated to microseconds.
>=3 = seconds and nanoseconds, maximum precision.
.Ed
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

71
share/man/man9/vgone.9 Normal file
View File

@ -0,0 +1,71 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd November 21, 2001
.Dt VGONE 9
.Os
.Sh NAME
.Nm vgone
.Nm vgonel
.Nd "prepare a vnode for reuse"
.Sh SYNOPSIS
.In sys/param.h
.In sys/vnode.h
.Ft void
.Fn vgone "struct vnode *vp"
.Ft void
.Fn vgonel "struct vnod *vp" "struct thread *td"
.Sh DESCRIPTION
.Fn vgone
and
.Fn vgonel
prepare a vnode for reuse by another filesystem.
The preparation includes the cleaning of all filesystem specific data and
the removal from its mount point vnode list.
.Pp
If the vnode has a usecount of zero, and its
.Dv VDOOMED
flag is not set it is moved to the head of the free list as in most cases the vnode
is about to be reused, or its filesystem being unmounted.
.Pp
The difference between
.Fn vgone
and
.Fn vgonel
is that
.Fn vgone
locks the vnode interlock and then calls
.Fn vgonel
while
.Fn vgonel
expects the interlock to already be locked.
.Sh SEE ALSO
.Xr vclean 9
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

62
share/man/man9/vhold.9 Normal file
View File

@ -0,0 +1,62 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd November 21, 2001
.Dt VHOLD 9
.Os
.Sh NAME
.Nm vhold
.Nm vdrop
.Nd "aquire/release a hold on a vnode"
.Sh SYNOPSIS
.In sys/param.h
.In sys/vnode.h
.Ft void
.Fn vhold "struct vnode *vp"
.Ft void
.Fn vdrop "struct vnode *vp"
.Sh DESCRIPTION
The
.Fn vhold
function increments the v_holdcnt of the given vnode.
If the vnode has already been added to the free list and is still referenced
it will be removed.
.Pp
The
.Fn vdrop
function decrements the v_holdcnt of the vnode.
If the holdcount is zero or less prior to calling
.Fn vdrop
the system will panic.
If the vnode is no longer referenced it will freed.
.Sh SEE ALSO
.Xr vfree 9 ,
.Xr vbusy 9
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

View File

@ -0,0 +1,164 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd December 1, 2001
.Dt VM_PAGE_BITS 9
.Os
.Sh NAME
.Nm vm_page_bits ,
.Nm vm_page_set_validclean ,
.Nm vm_page_clear_dirty ,
.Nm vm_page_set_invalid ,
.Nm vm_page_zero_invalid ,
.Nm vm_page_is_valid ,
.Nm vm_page_test_dirty ,
.Nm vm_page_dirty ,
.Nm vm_page_undirty
.Nd "manage page clean and dirty bits"
.Sh SYNOPSIS
.In sys/param.h
.In vm/vm.h
.In vm/vm_page.h
.Ft int
.Fn vm_page_bits "int base" "int size"
.Ft void
.Fn vm_page_set_validclean "vm_page_t m" "int base" "int size"
.Ft void
.Fn vm_page_clear_dirty "vm_page_t m" "int base" "int size"
.Ft void
.Fn vm_page_set_invalid "vm_page_t m" "int base" "int size"
.Ft void
.Fn vm_page_zero_invalid "vm_page_t m" "boolean_t setvalid"
.Ft int
.Fn vm_page_is_valid "vm_page_t m" "int base" "int size"
.Ft void
.Fn vm_page_test_dirty "vm_page_t m"
.Ft void
.Fn vm_page_dirty "vm_page_t m"
.Ft void
.Fn vm_page_undirty "vm_page_t m"
.Sh DESCRIPTION
.Fn vm_page_bits
calculates the bits representing the
.Dv DEV_BSIZE
range of bytes between
.Fa base
and
.Fa size .
The byte range is expected to be within a single page, and if
.Fa size
is zero no bits will be set.
.Pp
.\" ------------------- VM_PAGE_SET_VALIDCLEAN -------------------
.Fn vm_page_set_validclean
flags the byte range between
.Fa base
and
.Fa size
as valid and clean.
The range is expected to be
.Dv DEV_BSIZE
aligned and no larger than
.Dv PAGE_SIZE .
If it is not properly aligned, any unaligned chucks of the
.Dv DEV_BSIZE
blocks at the beginning and end of the range will be zeroed.
.Pp
If
.Fa base
is zero and
.Fa size
is one page the modified bit in the page map is cleared; as well,
the
.Dv PG_NOSYNC
flag is cleared.
.Pp
.Fn vm_page_clear_dirty
clears the dirty bits within a page in the range between
.Fa base
and
.Fa size .
The bits representing the range are calculated by calling
.Fn vm_page_bits .
.Pp
.Fn vm_page_set_invalid
clears the bits in both the valid and dirty flags representing
the
.Dv DEV_BSIZE
blocks between
.Fa base
and
.Fa size
in the page.
The bits are calculated by calling
.Fn vm_page_bits .
As well as clearing the bits within the page, the generation
number within the object holding the page is incremented.
.Pp
.Fn vm_page_zero_invalid
zeros all of the blocks within the page that are currently
flaged as invalid.
If
.Fa setvalid
is TRUE, all of the valid bits within the page are set.
.Pp
In some cases, such as NFS, the valid bits cannot be set
in order to maintain cache consistency.
.Pp
.Fn vm_page_is_valid
checks to determine if the all of the
.Dv DEV_BSIZE
blocks between
.Fa base
and
.Fa size
of the page are valid.
If
.Fa size
is zero and the page is entirely invalid
.Fn vm_page_is_valid
will return TRUE, in all other cases
a size of zero will return FALSE.
.Pp
.Fn vm_page_test_dirty
checks if a page has been modified via any of its physical maps,
and if so flags the entire page as dirty.
.Fn vm_page_dirty
is called to modify the dirty bits.
.Pp
.Fn vm_page_dirty
flags the entire page as dirty.
It is expected that the page is not currently on the cache queue.
.Pp
.Fn vm_page_undirty
clears all of the dirty bits in a page.
.Sh NOTES
None of these functions are allowed to block.
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

View File

@ -0,0 +1,59 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd July 30, 2001
.Dt VM_PAGE_DONTNEED 9
.Os
.Sh NAME
.Nm vm_page_dontneed
.Nd "indicate that a page is not needed anymore"
.Sh SYNOPSIS
.In sys/param.h
.In vm/vm.h
.In vm/vm_page.h
.Ft void
.Fn vm_page_dontneed "vm_page_t m"
.Sh DESCRIPTION
The
.Fn vm_page_dontneed
function advises the VM system that the given page is no longer
required.
If the page is already in the inactive queue or the cache queue this
function does nothing; otherwise the page is deactivated.
.Pp
Note that
.Fn vm_page_dontneed
does not necessarily deactivate a page, but instead implements an
algorithm that attempts to prevent small objects from having their
pages reused too quickly, and large objects from flushing smaller
ones from the queues as their pages are released.
.Sh SEE ALSO
.Xr vm_page_deactivate 9
.Sh AUTHORS
This manual page was written by
.An Chad David Aq davidc@acns.ab.ca .

View File

@ -0,0 +1,70 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd August 7, 2001
.Dt VM_PAGE_GRAB 9
.Os
.Sh NAME
.Nm vm_page_grab
.Nd "returns a page from an object"
.Sh SYNOPSIS
.In sys/param.h
.In vm/vm.h
.In vm/vm_page.h
.Ft vm_page_t
.Fn vm_page_grab "vm_object_t object" "vm_pindex_t pindex" "int allocflags"
.Sh DESCRIPTION
The
.Fn vm_page_grab
function returns the page at
.Fa pindex
from the given object.
If the page exists and is busy
.Fn vm_page_grab
will sleep while waiting for it.
If the page does not exists it is allocated.
.Pp
If
.Dv VM_ALLOC_RETRY
is not set in
.Fa allocflags
and the function sleeps, either getting the page from the object
or while allocating it,
.Dv NULL
is returned.
.Sh RETURN VALUES
If successful
.Fn vm_page_grab
return the page; otherwise,
.Dv NULL
is returned.
.Sh SEE ALSO
.Xr vm_page_alloc 9
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .

View File

@ -0,0 +1,56 @@
.\"
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
.\"
.\" 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(s), this list of conditions and the following disclaimer as
.\" the first lines of this file unmodified other than the possible
.\" addition of one or more copyright notices.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$
.\"
.Dd July 17, 2001
.Dt VM_PAGE_UNMANAGE 9
.Os
.Sh NAME
.Nm vm_page_unmanage
.Nd "make a page unmanaged"
.Sh SYNOPSIS
.In sys/param.h
.In vm/vm.h
.In vm/vm_page.h
.Ft void
.Fn vm_page_unmanage "vm_page_t m"
.Sh DESCRIPTION
The
.Fn vm_page_unmanage
function flags that the page should no longer be managed by the VM system like
other pages.
The page is removed from any page queue it may be on, and after its
.Dv PG_UNMANAGED
flag is set the page daemon will ignore it (if the page is
currently wired it will not be removed from its current queue).
.Pp
Unmanaged pages are used by
.Dv OBJT_PHYS
objects to provide physical memory backed storage.
.Sh AUTHORS
This man page was written by
.An Chad David Aq davidc@acns.ab.ca .