mdoc(7) police: fixed markup and some content typos.
This commit is contained in:
parent
a6a8d8e94c
commit
6468798b09
@ -31,26 +31,35 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm cdevsw_add
|
||||
.Nd "Adds a cdevsw entry"
|
||||
.Nd adds a
|
||||
.Vt cdevsw
|
||||
entry
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/conf.h>
|
||||
.In sys/param.h
|
||||
.In sys/conf.h
|
||||
.Ft int
|
||||
.Fn cdevsw_add "struct cdevsw *newentry"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn cdevsw_add
|
||||
function adds
|
||||
.Ar newentry
|
||||
to the cdevsw table if its major number is greater than or equal to zero,
|
||||
and is less than NUMCDEVSW.
|
||||
.Fa newentry
|
||||
to the
|
||||
.Va cdevsw
|
||||
table if its major number is greater than or equal to zero,
|
||||
and is less than
|
||||
.Dv NUMCDEVSW .
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa newentry"
|
||||
.It Fa newentry
|
||||
The device to add to the table.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
A value of 0 is returned on success; otherwise, EINVAL is returned
|
||||
A value of 0 is returned on success; otherwise,
|
||||
.Er EINVAL
|
||||
is returned
|
||||
indicating that the major number is not in the valid range.
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,26 +31,35 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm cdevsw_remove
|
||||
.Nd "Removes a cdevsw entry"
|
||||
.Nd removes a
|
||||
.Vt cdevsw
|
||||
entry
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/conf.h>
|
||||
.In sys/param.h
|
||||
.In sys/conf.h
|
||||
.Ft int
|
||||
.Fn cdevsw_add "struct cdevsw *oldentry"
|
||||
.Fn cdevsw_remove "struct cdevsw *oldentry"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn cdevsw_remove
|
||||
function removes
|
||||
.Ar oldentry
|
||||
from the cdevsw table if its major number is greater than or equal to zero,
|
||||
and is less than NUMCDEVSW.
|
||||
.Fa oldentry
|
||||
from the
|
||||
.Va cdevsw
|
||||
table if its major number is greater than or equal to zero,
|
||||
and is less than
|
||||
.Dv NUMCDEVSW .
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa oldentry"
|
||||
.It Fa oldentry
|
||||
The device to remove from the table.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
A value of 0 is returned on success; otherwise, EINVAL is returned
|
||||
A value of 0 is returned on success; otherwise,
|
||||
.Er EINVAL
|
||||
is returned
|
||||
indicating that the major number is not in the valid range.
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,25 +31,38 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm devsw
|
||||
.Nd "Checks if the vnode represents a disk"
|
||||
.Nd "checks if the vnode represents a disk"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/conf.h>
|
||||
.Ft struct cdevsw *
|
||||
.In sys/conf.h
|
||||
.Ft "struct cdevsw *"
|
||||
.Fn devsw "dev_t dev"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function returns a pointer to the cdevsw structure associated
|
||||
with this character device id. If dev->si_cdevsw is set it is
|
||||
.Fn devsw
|
||||
function returns a pointer to the
|
||||
.Vt cdevsw
|
||||
structure associated
|
||||
with this character device ID.
|
||||
If
|
||||
.Fa dev->si_cdevsw
|
||||
is set it is
|
||||
returned; otherwise, the
|
||||
.Ar major(9)
|
||||
offset into the cdevsw array is returned.
|
||||
.Xr major 9
|
||||
offset into the
|
||||
.Va cdevsw
|
||||
array is returned.
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar dev
|
||||
The device whose cdevsw entry should be returned.
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa dev"
|
||||
.It Fa dev
|
||||
The device whose
|
||||
.Vt cdevsw
|
||||
entry should be returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
A pointer to a cdevsw structure.
|
||||
A pointer to a
|
||||
.Vt cdevsw
|
||||
structure.
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,29 +31,31 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm lockcount
|
||||
.Nd "Returns the reference count of a lock"
|
||||
.Nd "returns the reference count of a lock"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/lockmgr.h>
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockcount "struct lock *lkp"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function returns the reference count of the lock. The reference
|
||||
.Fn lockcount
|
||||
function returns the reference count of the lock.
|
||||
The reference
|
||||
count is the sum of exclusive locks and shared locks.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag
|
||||
.It Ar lkp
|
||||
.Bl -tag -xwidth ".Fa lkp"
|
||||
.It Fa lkp
|
||||
The lock to return the reference count on.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
An integer greater than or equal to zero.
|
||||
.Sh SEE ALSO
|
||||
.Xr lockmgr 9
|
||||
.Xr lockdestroy 9
|
||||
.Xr lockdestroy 9 ,
|
||||
.Xr lockmgr 9 ,
|
||||
.Xr lockmgr_printinfo 9 ,
|
||||
.Xr lockstatus 9
|
||||
.Xr lockmgr_printinfo
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,26 +31,28 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm lockdestroy
|
||||
.Nd "Destroys a lock"
|
||||
.Nd "destroys a lock"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/lockmgr.h>
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockdestroy "struct lock *lkp"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function destroys the given lock. (Currently is does nothing!)
|
||||
.Fn lockdestroy
|
||||
function destroys the given lock.
|
||||
(Currently is does nothing!)
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag
|
||||
.It Ar lkp
|
||||
The lock to destroy
|
||||
.Bl -tag -xwidth ".Fa lkp"
|
||||
.It Fa lkp
|
||||
The lock to destroy
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr lockmgr 9
|
||||
.Xr lockcount 9
|
||||
.Xr lockcount 9 ,
|
||||
.Xr lockmgr 9 ,
|
||||
.Xr lockmgr_printinfo 9 ,
|
||||
.Xr lockstatus 9
|
||||
.Xr lockmgr_printinfo 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,94 +31,125 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm lockmgr
|
||||
.Nd "Aquires, releases and updates locks"
|
||||
.Nd "acquires, releases and updates locks"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/lockmgr.h>
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockmgr "struct lock *lkp" "u_int flags" "struct mtx *interlkp" "struct proc *p"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn lockmgr
|
||||
function handles general locking functionality within the kernel, including
|
||||
support for shared and exclusive locks, and recursion. Locks can also be
|
||||
upgraded and downgraded.
|
||||
support for shared and exclusive locks, and recursion.
|
||||
Locks can also be upgraded and downgraded.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width interlkp
|
||||
.It Ar lkp
|
||||
.Bl -tag -xwidth ".Fa interlkp"
|
||||
.It Fa lkp
|
||||
A pointer to lock to manipulate.
|
||||
.It Ar flags
|
||||
.It Fa flags
|
||||
Flags indicating what action is to be taken.
|
||||
.Pp
|
||||
LK_SHARED - Aquire a shared lock. If we currently hold an exclusive lock it will
|
||||
.Bl -tag -xwidth ".Dv LK_EXCLUPGRADE"
|
||||
.It Dv LK_SHARED
|
||||
Aquire a shared lock.
|
||||
If we currently hold an exclusive lock it will be downgraded.
|
||||
.It Dv LK_EXCLUSIVE
|
||||
Aquire an exclusive lock.
|
||||
If we already hold an exclusive lock and
|
||||
.Dv LK_CANRECURSE
|
||||
is not set we will panic.
|
||||
.It Dv LK_DOWNGRADE
|
||||
Downgrade our exclusive lock to a shared lock.
|
||||
Downgrading a shared lock is not valid.
|
||||
If the exclusive lock has been recursed, all references will
|
||||
be downgraded.
|
||||
.Pp
|
||||
LK_EXCLUSIVE - Aquire an exclusive lock. If we already hold an exclusive lock
|
||||
and LK_CANRECURSE is not set we will panic.
|
||||
.Pp
|
||||
LK_DOWNGRADE - Downgrade our exclusive lock to a shared lock. Downgrading a shared
|
||||
lock is not valid. If the exclusive lock has been recursed, all references will
|
||||
be downgraded.
|
||||
.Pp
|
||||
LK_EXCLUPGRADE - Upgrade our lock to an exclusive lock. Will fail with EBUSY if
|
||||
there is someone ahead of use waiting for an upgrade. If this call fails we loose
|
||||
our shared lock. Upgrading an exclusive lock will cause a panic.
|
||||
.Pp
|
||||
LK_UPGRADE - Upgrades our lock to an exclusive lock. If this call fails we loose
|
||||
our shared lock. Upgrading an exclusive lock will cause a panic.
|
||||
.Pp
|
||||
LK_RELEASE - Release the lock. Releasing a lock that you do not hold can cause
|
||||
.It Dv LK_EXCLUPGRADE
|
||||
Upgrade our lock to an exclusive lock.
|
||||
Will fail with
|
||||
.Er EBUSY
|
||||
if there is someone ahead of use waiting for an upgrade.
|
||||
If this call fails we loose
|
||||
our shared lock.
|
||||
Upgrading an exclusive lock will cause a panic.
|
||||
.It Dv LK_UPGRADE
|
||||
Upgrades our lock to an exclusive lock.
|
||||
If this call fails we loose
|
||||
our shared lock.
|
||||
Upgrading an exclusive lock will cause a panic.
|
||||
.It Dv LK_RELEASE
|
||||
Release the lock.
|
||||
Releasing a lock that you do not hold can cause
|
||||
a panic.
|
||||
.Pp
|
||||
LK_DRAIN - Waits for all activity on the lock to end, and then marks it decommissioned.
|
||||
.It Dv LK_DRAIN
|
||||
Waits for all activity on the lock to end, and then marks it decommissioned.
|
||||
This is used before freeing a lock that is part of a piece of memory that is about to
|
||||
be freed. (As documented in lockmgr.h)
|
||||
.Pp
|
||||
LK_SLEEPFAIL - If we had to sleep for the lock then fail.
|
||||
.Pp
|
||||
LK_NOWAIT - Do not allow the call to sleep. This can be used to test the lock.
|
||||
.Pp
|
||||
LK_CANRECURSE - It is ok to recurse on an exclusive lock. For every lock there
|
||||
be freed.
|
||||
(As documented in
|
||||
.Pa lockmgr.h . )
|
||||
.It Dv LK_SLEEPFAIL
|
||||
If we had to sleep for the lock then fail.
|
||||
.It Dv LK_NOWAIT
|
||||
Do not allow the call to sleep.
|
||||
This can be used to test the lock.
|
||||
.It Dv LK_CANRECURSE
|
||||
It is ok to recurse on an exclusive lock.
|
||||
For every lock there
|
||||
must be a release.
|
||||
.Pp
|
||||
LK_INTERLOCK - Unlock the interlock, which is of course locked already.
|
||||
.Pp
|
||||
.It Ar interlkp
|
||||
.It Dv LK_INTERLOCK
|
||||
Unlock the interlock, which is of course locked already.
|
||||
.El
|
||||
.It Fa interlkp
|
||||
An interlock mutex for controlling group access to the lock.
|
||||
If LK_INTERLOCK is specified
|
||||
.Nm
|
||||
If
|
||||
.Dv LK_INTERLOCK
|
||||
is specified,
|
||||
.Fn lockmgr
|
||||
assumes
|
||||
.Ar interlkp
|
||||
.Fa interlkp
|
||||
is currently owned and not recursed, and will return it unlocked.
|
||||
See mtx_assert(9).
|
||||
.It Ar p
|
||||
The process responsible for this call. NULL becomes LK_KERNPROC.
|
||||
See
|
||||
.Xr mtx_assert 9 .
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.Dv NULL
|
||||
becomes
|
||||
.Dv LK_KERNPROC .
|
||||
.El
|
||||
.Sh LOCKS
|
||||
If LK_INTERLOCK is specified then
|
||||
.Ar interlkp
|
||||
If
|
||||
.Dv LK_INTERLOCK
|
||||
is specified then
|
||||
.Fa interlkp
|
||||
must be held prior to calling
|
||||
.Nm
|
||||
.Fn lockmgr
|
||||
and will be returned unlocked.
|
||||
.Pp
|
||||
Upgrade attempts that fail result in the loss of the lock that
|
||||
is currently held. As well, it is not valid to upgrade an
|
||||
is currently held.
|
||||
As well, it is not valid to upgrade an
|
||||
exclusive lock, and a panic will be the result of trying.
|
||||
.Sh RETURN VALUES
|
||||
A value of 0 is returned on success.
|
||||
A value of 0 is returned on success.
|
||||
.Sh ERRORS
|
||||
.Bl -tag
|
||||
.It Bq EBUSY
|
||||
Either LK_NOWAIT was specified and lockmgr would have slept, or another
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er EBUSY
|
||||
Either
|
||||
.Dv LK_NOWAIT
|
||||
was specified and
|
||||
.Fn lockmgr
|
||||
would have slept, or another
|
||||
process was ahead of you in line for an exclusive upgrade.
|
||||
.It Bq ENOLCK
|
||||
LK_SLEEP_FAIL was set and we slept.
|
||||
.It Bq Er ENOLCK
|
||||
.Dv LK_SLEEP_FAIL
|
||||
was set and we slept.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr lockcount 9 ,
|
||||
.Xr lockdestroy 9 ,
|
||||
.Xr lockmgr_printinfo 9 ,
|
||||
.Xr lockstatus 9 ,
|
||||
.Xr mutex 9
|
||||
.Xr lockcount 9
|
||||
.Xr lockdestroy 9
|
||||
.Xr lockstatus 9
|
||||
.Xr lockmgr_printinfo 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,29 +31,30 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm lockmgr_printinfo
|
||||
.Nd "Prints information about the lock."
|
||||
.Nd "prints information about the lock"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/lockmgr.h>
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft void
|
||||
.Fn lockmgr_printinfo "struct lock *lkp"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn lockmgr_printinfo
|
||||
function prints information about the lock including the lock
|
||||
time and the wait count.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag
|
||||
.It Ar lkp
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa lkp"
|
||||
.It Fa lkp
|
||||
The lock to print.
|
||||
.El
|
||||
.Sh NOTES
|
||||
This function seems to only exist for debugging purposes.
|
||||
.Sh SEE ALSO
|
||||
.Xr lockmgr 9
|
||||
.Xr lockcount 9
|
||||
.Xr lockdestroy 9
|
||||
.Xr lockcount 9 ,
|
||||
.Xr lockdestroy 9 ,
|
||||
.Xr lockmgr 9 ,
|
||||
.Xr lockstatus 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,49 +31,53 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm lockstatus
|
||||
.Nd "Returns the lock status"
|
||||
.Nd "returns the lock status"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/lockmgr.h>
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockstatus "struct lock *lkp" "struct proc *p"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function returns the status of the lock in relation to the proc
|
||||
.Fn lockstatus
|
||||
function returns the status of the lock in relation to the
|
||||
.Vt proc
|
||||
passed to it.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag
|
||||
.It Ar lkp
|
||||
.Bl -tag -xwidth ".Fa lkp"
|
||||
.It Fa lkp
|
||||
The lock to return the status of.
|
||||
.It Ar p
|
||||
The process to check any exclusive locks against. If
|
||||
.Ar p
|
||||
is NULL and an exclusive lock is held
|
||||
.Ar LK_EXCLUSIVE
|
||||
.It Fa p
|
||||
The process to check any exclusive locks against.
|
||||
If
|
||||
.Fa p
|
||||
is
|
||||
.Dv NULL
|
||||
and an exclusive lock is held,
|
||||
.Dv LK_EXCLUSIVE
|
||||
is returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.It Ar LK_EXCLUSIVE
|
||||
.Bl -tag -xwidth ".Dv LK_EXCLUSIVE"
|
||||
.It Dv LK_EXCLUSIVE
|
||||
An exclusive lock is held by the process
|
||||
.Ar p
|
||||
.Fa p
|
||||
passed in.
|
||||
.It Ar LK_EXCLOTHER
|
||||
.It Dv LK_EXCLOTHER
|
||||
An exclusive lock is held by someone other then the process
|
||||
.Ar p
|
||||
.Fa p
|
||||
passed in.
|
||||
.It Ar LK_SHARED
|
||||
.It Dv LK_SHARED
|
||||
A shared lock is held.
|
||||
count is the sum of exclusive locks and shared locks.
|
||||
.It Ar 0
|
||||
.It 0
|
||||
The lock is not held by anyone.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr lockmgr 9
|
||||
.Xr lockcount 9
|
||||
.Xr lockdestroy 9
|
||||
.Xr lockcount 9 ,
|
||||
.Xr lockdestroy 9 ,
|
||||
.Xr lockmgr 9 ,
|
||||
.Xr lockmgr_printinfo 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,26 +31,29 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm major
|
||||
.Nd "Returns the major number for the device"
|
||||
.Nd "returns the major number for the device"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/systm.h>
|
||||
.In sys/systm.h
|
||||
.Ft int
|
||||
.Fo major
|
||||
.Fa "dev_t dev"
|
||||
.Fc
|
||||
.Fn major "dev_t dev"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn major
|
||||
function returns the major device number for the given device.
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar dev
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa dev"
|
||||
.It Fa dev
|
||||
The device whose major device number should be returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
An integer greater than zero and less than NUMCDEVSW, or NOUDEV
|
||||
An integer greater than zero and less than
|
||||
.Dv NUMCDEVSW ,
|
||||
or
|
||||
.Dv NOUDEV
|
||||
if the device is invalid.
|
||||
.Sh SEE ALSO
|
||||
.Xr minor 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,25 +31,27 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm minor
|
||||
.Nd "Returns the minor number for the device"
|
||||
.Nd "returns the minor number for the device"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/systm.h>
|
||||
.In sys/systm.h
|
||||
.Ft int
|
||||
.Fo minor
|
||||
.Fa "dev_t dev"
|
||||
.Fc
|
||||
.Fn minor "dev_t dev"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn minor
|
||||
function returns the minor device number for the given device.
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar dev
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa dev"
|
||||
.It Fa dev
|
||||
The device whose minor device number should be returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
An integer greater than zero, or NOUDEV if the device is invalid.
|
||||
An integer greater than zero, or
|
||||
.Dv NOUDEV
|
||||
if the device is invalid.
|
||||
.Sh SEE ALSO
|
||||
.Xr major 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,28 +31,28 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm umajor
|
||||
.Nd "Returns the major number from the raw device number"
|
||||
.Nd "returns the major number from the raw device number"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/systm.h>
|
||||
.In sys/systm.h
|
||||
.Ft int
|
||||
.Fo umajor
|
||||
.Fa "udev_t dev"
|
||||
.Fc
|
||||
.Fn umajor "udev_t dev"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn umajor
|
||||
function returns the major device number form the given raw device
|
||||
number.
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar dev
|
||||
The device number whose major id should be calculated and returned.
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa dev"
|
||||
.It Fa dev
|
||||
The device number whose major ID should be calculated and returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
An integer greater than or equal to zero.
|
||||
.Sh SEE ALSO
|
||||
.Xr major 9 ,
|
||||
.Xr minor 9 ,
|
||||
.Xr uminor 9
|
||||
.Xr minor 9
|
||||
.Xr major 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,28 +31,28 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm uminor
|
||||
.Nd "Returns the minor number from the raw device number"
|
||||
.Nd "returns the minor number from the raw device number"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/systm.h>
|
||||
.In sys/systm.h
|
||||
.Ft int
|
||||
.Fo uminor
|
||||
.Fa "udev_t dev"
|
||||
.Fc
|
||||
.Fn uminor "udev_t dev"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn uminor
|
||||
function returns the minor device number from the raw device number.
|
||||
.Pp
|
||||
Its argument is:
|
||||
.Bl -tag
|
||||
.It Ar dev
|
||||
Its argument is:
|
||||
.Bl -tag -xwidth ".Fa dev"
|
||||
.It Fa dev
|
||||
The raw device number from which the minor device number should be
|
||||
calculated.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
An integer greater than or equal to zero.
|
||||
.Sh SEE ALSO
|
||||
.Xr major 9 ,
|
||||
.Xr minor 9 ,
|
||||
.Xr umajor 9
|
||||
.Xr major 9
|
||||
.Xr minor 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,47 +31,70 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm vfs_busy
|
||||
.Nd "Marks a mount point as busy."
|
||||
.Nd "marks a mount point as busy"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/mount.h>
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft int
|
||||
.Fn vfs_busy "struct mount *mp" "int flags" "struct mtx *interlkp" "struct proc *p"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function marks a mount point as busy. The purpose of this
|
||||
function is to synchronize access to a mount point. It also
|
||||
delays unmounting by sleeping on mp if the MNTK_UNMOUNT flag
|
||||
is set in mp->mnt_kern_flag and the LK_NOWAIT flag is NOT set.
|
||||
.Fn vfs_busy
|
||||
function marks a mount point as busy.
|
||||
The purpose of this
|
||||
function is to synchronize access to a mount point.
|
||||
It also delays unmounting by sleeping on mp if the
|
||||
.Dv MNTK_UNMOUNT
|
||||
flag is set in
|
||||
.Fa mp->mnt_kern_flag
|
||||
and the
|
||||
.Dv LK_NOWAIT
|
||||
flag is
|
||||
.Em not
|
||||
set.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width interlkp
|
||||
.It Ar mp
|
||||
.Bl -tag -xwidth ".Fa interlkp"
|
||||
.It Fa mp
|
||||
The mount point to busy.
|
||||
.It Ar flags
|
||||
.It Fa flags
|
||||
Flags controlling the operation of
|
||||
.Nm
|
||||
.
|
||||
.Pp
|
||||
LK_NOWAIT - do not sleep if MNTK_UNMOUNT is set.
|
||||
.It Ar interlkp
|
||||
The interlock mutex for mp->mount_lock. If there is any chance
|
||||
the mount point is being unmounted and LK_NOWAIT is not set then
|
||||
.Fn vfs_busy .
|
||||
.Bl -tag -xwidth ".Dv LK_NOWAIT"
|
||||
.It Dv LK_NOWAIT
|
||||
do not sleep if
|
||||
.Dv MNTK_UNMOUNT
|
||||
is set.
|
||||
.El
|
||||
.It Fa interlkp
|
||||
The interlock mutex for
|
||||
.Fa mp->mount_lock .
|
||||
If there is any chance
|
||||
the mount point is being unmounted and
|
||||
.Dv LK_NOWAIT
|
||||
is not set then
|
||||
interlock must be valid locked mutex.
|
||||
.It Ar p
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.El
|
||||
.Sh LOCKS
|
||||
If interlkp is a valid pointer it must be locked on entry,
|
||||
If
|
||||
.Fa interlkp
|
||||
is a valid pointer it must be locked on entry,
|
||||
and it will not be unlocked even on error.
|
||||
.Sh RETURN VALUES
|
||||
A 0 value is returned on success. If the mount point is being
|
||||
unmounted ENOENT will always be returned.
|
||||
A 0 value is returned on success.
|
||||
If the mount point is being
|
||||
unmounted
|
||||
.Er ENOENT
|
||||
will always be returned.
|
||||
.Sh ERRORS
|
||||
.Bl -tag
|
||||
.It Bq ENOENT
|
||||
The mount point is being unmounted (MNTK_UNMOUNT is set).
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er ENOENT
|
||||
The mount point is being unmounted
|
||||
.Dv ( MNTK_UNMOUNT
|
||||
is set).
|
||||
.El
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,81 +31,100 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm vfs_mount
|
||||
.Nd "Generic filesystem mount function"
|
||||
.Nd "generic filesystem mount function"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/mount.h>
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft int
|
||||
.Fn vfs_mount "struct proc *vp" "char *fstype" "char *fspath" "int fsflags" "void *fsdata"
|
||||
.Fn vfs_mount "struct proc *p" "char *fstype" "char *fspath" "int fsflags" "void *fsdata"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn vfs_mount
|
||||
function handles the generic portion of mounting a filesystem,
|
||||
and calls the filesystem specific mount function after verifying
|
||||
its parameters and setting up the structures expected by the
|
||||
underlying mount code.
|
||||
.Pp
|
||||
.Nm
|
||||
is called directly by the mount system call.
|
||||
.Fn vfs_mount
|
||||
is called directly by the
|
||||
.Xr mount 2
|
||||
system call.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width fsflags
|
||||
.It Ar p
|
||||
.Bl -tag -xwidth ".Fa fsflags"
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Ar fstype
|
||||
.It Fa fstype
|
||||
The type of filesystem being mounted.
|
||||
.It Ar fspath
|
||||
.It Fa fspath
|
||||
The path to the mount point of the filesystem.
|
||||
.It Ar fsflags
|
||||
Flags controlling the mount. See mount(8) for details.
|
||||
.It Fa fsflags
|
||||
Flags controlling the mount.
|
||||
See
|
||||
.Xr mount 2
|
||||
for details.
|
||||
.Pp
|
||||
MNT_EXPORTED MNT_NOSUID MNT_NODEV MNT_UPDATE MNT_RELOAD
|
||||
MNT_FORCE MNT_ASYNC MNT_SYNCHRONOUS MNT_UNION MNT_NOATIME
|
||||
MNT_SNAPSHOT MNT_NOCLUSTERR MNT_NOCLUSTERW MNT_IGNORE
|
||||
MNT_UNION MNT_NOSYMFOLLOW
|
||||
.It Ar fsdata
|
||||
Filesystem specific data structure. It is in userspace
|
||||
.Dv MNT_EXPORTED , MNT_NOSUID , MNT_NODEV , MNT_UPDATE , MNT_RELOAD ,
|
||||
.Dv MNT_FORCE , MNT_ASYNC , MNT_SYNCHRONOUS , MNT_UNION , MNT_NOATIME ,
|
||||
.Dv MNT_SNAPSHOT , MNT_NOCLUSTERR , MNT_NOCLUSTERW , MNT_IGNORE ,
|
||||
.Dv MNT_UNION , MNT_NOSYMFOLLOW .
|
||||
.It Fa fsdata
|
||||
Filesystem specific data structure.
|
||||
It is in userspace
|
||||
when passed to
|
||||
.Nm
|
||||
and is left untouched when passed to filesystems mount().
|
||||
.Fn vfs_mount
|
||||
and is left untouched when passed to filesystems
|
||||
.Fn mount .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
A 0 value is returned on success.
|
||||
A 0 value is returned on success.
|
||||
.Sh ERRORS
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er ENAMETOOLONG
|
||||
The fs type or the mount point path is too long or any individual
|
||||
path component is too long.
|
||||
.It Bq Er EPERM
|
||||
Permission denied. There are a number of reason this can occur
|
||||
Permission denied.
|
||||
There are a number of reason this can occur
|
||||
ranging from the user not having permission to mount a filesystem
|
||||
to the securelevel being to high to load the fstype module.
|
||||
to the securelevel being to high to load the
|
||||
.Fa fstype
|
||||
module.
|
||||
.It Bq Er EINVAL
|
||||
Invalid operation (ex: trying to update a non mount-point).
|
||||
.It Bq Er ENOENT
|
||||
The mount point does not exist (from namei)
|
||||
The mount point does not exist (from
|
||||
.Fn namei ) .
|
||||
.It Bq Er ELOOP
|
||||
The mount point is a muddle of links (from namei)
|
||||
The mount point is a muddle of links (from
|
||||
.Fn namei ) .
|
||||
.It Bq Er EOPNOTSUPP
|
||||
The operation is not supported (ex: reloading a r/w filesystem)
|
||||
The operation is not supported (ex: reloading a r/w filesystem).
|
||||
.It Bq Er EBUSY
|
||||
The mount point is busy or is not really a mount point (on update)
|
||||
The mount point is busy or is not really a mount point (on update).
|
||||
.It Bq Er ENOTDIR
|
||||
The mount point is not a directory
|
||||
The mount point is not a directory.
|
||||
.It Bq Er ENODEV
|
||||
The kernel linker was unable to load the specified fstype or
|
||||
was unable to find the specified fstype module.
|
||||
The kernel linker was unable to load the specified
|
||||
.Fa fstype
|
||||
or was unable to find the specified
|
||||
.Fa fstype
|
||||
module.
|
||||
.El
|
||||
.Pp
|
||||
Other errors can be returned by the filesystems mount() and
|
||||
you should check the specific filesystem for details. Also
|
||||
Other errors can be returned by the filesystems
|
||||
.Fn mount
|
||||
and
|
||||
you should check the specific filesystem for details.
|
||||
Also
|
||||
this call relies on a large number of other kernel services
|
||||
whose errors it returns so this list my not be exhaustive.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr mount 2
|
||||
.Xr mount 8
|
||||
.Xr mount 9
|
||||
.Xr mount 2 ,
|
||||
.Xr mount 8 ,
|
||||
.Xr ffs_mount 9
|
||||
vfs.usermount
|
||||
.Pp
|
||||
.Va vfs.usermount
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,33 +31,36 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm vfs_unbusy
|
||||
.Nd "Unbusy a mount point.
|
||||
.Nd "unbusy a mount point"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/mount.h>
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft void
|
||||
.Fn vfs_unbusy "struct mount *mp" "struct proc *p"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
function unbusys (unlocks) a mount point by unlocking
|
||||
mp->mnt_lock. The lock is typically aquired by calling
|
||||
vfs_busy() prior to this call.
|
||||
.Fn vfs_unbusy
|
||||
function unbusies (unlocks) a mount point by unlocking
|
||||
.Fa mp->mnt_lock .
|
||||
The lock is typically aquired by calling
|
||||
.Xr vfs_busy 9
|
||||
prior to this call.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width uap
|
||||
.It Ar mp
|
||||
.Bl -tag -xwidth ".Fa mp"
|
||||
.It Fa mp
|
||||
The mount point to unbusy (unlock).
|
||||
.It Ar p
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.El
|
||||
.Sh LOCKS
|
||||
.Ar mnt_lock
|
||||
.Va mnt_lock
|
||||
must be locked in
|
||||
.Ar mp
|
||||
.Fa mp
|
||||
prior to calling
|
||||
this function, and it will be unlocked upon return.
|
||||
.Sh SEE ALSO
|
||||
.Xr vfs_busy 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,35 +31,42 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm vinvalbuf
|
||||
.Nd "Flushes and invalidates all buffers associated with a vnode"
|
||||
.Nd "flushes and invalidates all buffers associated with a vnode"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/vnode.h>
|
||||
.In sys/param.h
|
||||
.In sys/vnode.h
|
||||
.Ft int
|
||||
.Fn vinvalbuf "struct vnode *vp" "int flags" "struct ucred *cred" "struct proc *p" "int slpflag" "int slptimeo"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn vinvalbuf
|
||||
function invalidates all of the buffers associated with the given vnode.
|
||||
This includes buffers on the clean list and the dirty list. If the V_SAVE
|
||||
This includes buffers on the clean list and the dirty list.
|
||||
If the
|
||||
.Dv V_SAVE
|
||||
flag is specified then the buffers on the dirty list are synced prior to being
|
||||
released. If there is a VM Object associated with the vnode it is removed.
|
||||
released.
|
||||
If there is a VM Object associated with the vnode, it is removed.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width spltimeo
|
||||
.It Ar vp
|
||||
.Bl -tag -xwidth ".Fa spltimeo"
|
||||
.It Fa vp
|
||||
A pointer to the vnode whose buffers will be invalidated.
|
||||
.It Ar flags
|
||||
The only supported flag is V_SAVE and it indicates that dirty buffers should by synced.
|
||||
.It Ar cred
|
||||
.It Fa flags
|
||||
The only supported flag is
|
||||
.Dv V_SAVE
|
||||
and it indicates that dirty buffers should by synced.
|
||||
.It Fa cred
|
||||
The user credentials that are used to
|
||||
.Fn VOP_FSYNC ""
|
||||
buffers if V_SAVE is set.
|
||||
.It Ar p
|
||||
.Xr VOP_FSYNC 9
|
||||
buffers if
|
||||
.Dv V_SAVE
|
||||
is set.
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Ar slpflag
|
||||
.It Fa slpflag
|
||||
The slp flag that will be used in the priority of any sleeps in the function.
|
||||
.It Ar slptimeo
|
||||
.It Fa slptimeo
|
||||
The timeout for any sleeps in the function.
|
||||
.El
|
||||
.Sh LOCKS
|
||||
@ -67,32 +74,47 @@ The vnode is assumed to be locked prior to the call and remains locked upon retu
|
||||
.Pp
|
||||
Giant must be held by prior to the call and remains locked upon return.
|
||||
.Sh RETURN VALUES
|
||||
A 0 value is returned on success.
|
||||
A 0 value is returned on success.
|
||||
.Sh PSEUDOCODE
|
||||
.Bd -literal
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0);
|
||||
VOP_UNLOCK(devvp, 0, p);
|
||||
if (error)
|
||||
return (error);
|
||||
.Bd -literal -offset indent
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0);
|
||||
VOP_UNLOCK(devvp, 0, p);
|
||||
if (error)
|
||||
return (error);
|
||||
.Ed
|
||||
.Sh ERRORS
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er ENOSPC
|
||||
The filesystem is full. (With V_SAVE)
|
||||
The filesystem is full.
|
||||
(With
|
||||
.Dv V_SAVE )
|
||||
.It Bq Er EDQUOT
|
||||
Disc quota exceeded. (With V_SAVE)
|
||||
Disc quota exceeded.
|
||||
(With
|
||||
.Dv V_SAVE )
|
||||
.It Bq Er EWOULDBLOCK
|
||||
Sleep operation timed out (See slptimeo)
|
||||
Sleep operation timed out.
|
||||
(See
|
||||
.Fa slptimeo )
|
||||
.It Bq Er ERESTART
|
||||
A signal needs to be delivered and the system call should be restarted (With PCATCH set in slpflag)
|
||||
A signal needs to be delivered and the system call should be restarted.
|
||||
(With
|
||||
.Dv PCATCH
|
||||
set in
|
||||
.Fa slpflag )
|
||||
.It Bq Er EINTR
|
||||
The system has been interrupted by a signal (With PCATCH set in slpflag)
|
||||
The system has been interrupted by a signal.
|
||||
(With
|
||||
.Dv PCATCH
|
||||
set in
|
||||
.Fa slpflag )
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr brelse 9
|
||||
.Xr bremfree 9
|
||||
.Xr brelse 9 ,
|
||||
.Xr bremfree 9 ,
|
||||
.Xr tsleep 9 ,
|
||||
.Xr VOP_FSYNC 9
|
||||
.Xr tsleep 9
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
@ -31,31 +31,39 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm vn_isdisk
|
||||
.Nd "Checks if the vnode represents a disk"
|
||||
.Nd "checks if the vnode represents a disk"
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/param.h>
|
||||
.Fd #include <sys/vnode.h>
|
||||
.In sys/param.h
|
||||
.In sys/vnode.h
|
||||
.Ft int
|
||||
.Fn vn_isdisk "struct vnode *vp" "int *errp"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Fn vn_isdisk
|
||||
function checks to see if the vnode represents a disk.
|
||||
In order for the vnode to be a disk it must be a character
|
||||
device, v_rdev must be valid, and the cdevsw entrys flags
|
||||
must have D_DISK set.
|
||||
device,
|
||||
.Va v_rdev
|
||||
must be valid, and the
|
||||
.Vt cdevsw
|
||||
entry's
|
||||
.Va flags
|
||||
must have
|
||||
.Dv D_DISK
|
||||
set.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag errp
|
||||
.It Ar vp
|
||||
.Bl -tag -xwidth ".Fa errp"
|
||||
.It Fa vp
|
||||
The vnode to check.
|
||||
.It Ar errp
|
||||
A integer pointer to store the error number in if the call fails.
|
||||
.It Fa errp
|
||||
An integer pointer to store the error number in if the call fails.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
If the vnode represents a disk one is returned; otherwise, zero
|
||||
If the vnode represents a disk, 1 is returned; otherwise, zero
|
||||
is returned and
|
||||
.Ar errp
|
||||
.Fa errp
|
||||
will contain the error number.
|
||||
.Sh AUTHORS
|
||||
This man page was written by Chad David.
|
||||
This man page was written by
|
||||
.An Chad David .
|
||||
|
Loading…
Reference in New Issue
Block a user