Updates for changes made by KSE import.
Submitted by: Chad David <davidc@acns.ab.ca>
This commit is contained in:
parent
8975eded26
commit
211ab8715e
@ -36,7 +36,7 @@
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockmgr "struct lock *lkp" "u_int flags" "struct mtx *interlkp" "struct proc *p"
|
||||
.Fn lockmgr "struct lock *lkp" "u_int flags" "struct mtx *interlkp" "struct thread *td"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn lockmgr
|
||||
@ -47,7 +47,7 @@ Locks can also be upgraded and downgraded.
|
||||
Its arguments are:
|
||||
.Bl -tag -width ".Fa interlkp"
|
||||
.It Fa lkp
|
||||
A pointer to lock to manipulate.
|
||||
A pointer to the lock to manipulate.
|
||||
.It Fa flags
|
||||
Flags indicating what action is to be taken.
|
||||
.Bl -tag -width ".Dv LK_EXCLUPGRADE"
|
||||
@ -62,15 +62,13 @@ 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.
|
||||
If the exclusive lock has been recursed, all references will be downgraded.
|
||||
.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.
|
||||
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.
|
||||
@ -79,12 +77,11 @@ 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.
|
||||
Releasing a lock that you do not hold can cause a panic.
|
||||
.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.
|
||||
This is used before freeing a lock that is part of a piece of memory that is
|
||||
about to be freed.
|
||||
(As documented in
|
||||
.Pa sys/lockmgr.h . )
|
||||
.It Dv LK_SLEEPFAIL
|
||||
@ -94,8 +91,7 @@ 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.
|
||||
For every lock there must be a release.
|
||||
.It Dv LK_INTERLOCK
|
||||
Unlock the interlock, which is of course locked already.
|
||||
.El
|
||||
@ -110,8 +106,8 @@ assumes
|
||||
is currently owned and not recursed, and will return it unlocked.
|
||||
See
|
||||
.Xr mtx_assert 9 .
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Fa td
|
||||
The thread responsible for this call.
|
||||
.Dv NULL
|
||||
becomes
|
||||
.Dv LK_KERNPROC .
|
||||
@ -138,8 +134,8 @@ 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.
|
||||
would have slept, or another thread was ahead of you in line for an exclusive
|
||||
upgrade.
|
||||
.It Bq Er ENOLCK
|
||||
.Dv LK_SLEEP_FAIL
|
||||
was set and we slept.
|
||||
|
@ -36,22 +36,22 @@
|
||||
.In sys/types.h
|
||||
.In sys/lockmgr.h
|
||||
.Ft int
|
||||
.Fn lockstatus "struct lock *lkp" "struct proc *p"
|
||||
.Fn lockstatus "struct lock *lkp" "struct thread *td"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn lockstatus
|
||||
function returns the status of the lock in relation to the
|
||||
.Vt proc
|
||||
.Vt thread
|
||||
passed to it.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width ".Fa lkp"
|
||||
.It Fa lkp
|
||||
The lock to return the status of.
|
||||
.It Fa p
|
||||
The process to check any exclusive locks against.
|
||||
.It Fa td
|
||||
The thread to check any exclusive locks against.
|
||||
If
|
||||
.Fa p
|
||||
.Fa td
|
||||
is
|
||||
.Dv NULL
|
||||
and an exclusive lock is held,
|
||||
@ -61,12 +61,12 @@ is returned.
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag -width ".Dv LK_EXCLUSIVE"
|
||||
.It Dv LK_EXCLUSIVE
|
||||
An exclusive lock is held by the process
|
||||
.Fa p
|
||||
An exclusive lock is held by the thread
|
||||
.Fa td
|
||||
passed in.
|
||||
.It Dv LK_EXCLOTHER
|
||||
An exclusive lock is held by someone other then the process
|
||||
.Fa p
|
||||
An exclusive lock is held by someone other then the thread
|
||||
.Fa td
|
||||
passed in.
|
||||
.It Dv LK_SHARED
|
||||
A shared lock is held.
|
||||
|
@ -36,7 +36,7 @@
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft int
|
||||
.Fn vfs_busy "struct mount *mp" "int flags" "struct mtx *interlkp" "struct proc *p"
|
||||
.Fn vfs_busy "struct mount *mp" "int flags" "struct mtx *interlkp" "struct thread *td"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn vfs_busy
|
||||
@ -77,8 +77,8 @@ the mount point is being unmounted and
|
||||
.Dv LK_NOWAIT
|
||||
is not set then
|
||||
interlock must be valid locked mutex.
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Fa td
|
||||
The thread responsible for this call.
|
||||
.El
|
||||
.Sh LOCKS
|
||||
If
|
||||
|
@ -36,7 +36,7 @@
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft int
|
||||
.Fn vfs_mount "struct proc *p" "char *fstype" "char *fspath" "int fsflags" "void *fsdata"
|
||||
.Fn vfs_mount "struct thread *td" "char *fstype" "char *fspath" "int fsflags" "void *fsdata"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn vfs_mount
|
||||
@ -52,8 +52,8 @@ system call.
|
||||
.Pp
|
||||
Its arguments are:
|
||||
.Bl -tag -width ".Fa fsflags"
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Fa td
|
||||
The thread responsible for this call.
|
||||
.It Fa fstype
|
||||
The type of filesystem being mounted.
|
||||
.It Fa fspath
|
||||
|
@ -36,7 +36,7 @@
|
||||
.In sys/param.h
|
||||
.In sys/mount.h
|
||||
.Ft void
|
||||
.Fn vfs_unbusy "struct mount *mp" "struct proc *p"
|
||||
.Fn vfs_unbusy "struct mount *mp" "struct thread *td"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn vfs_unbusy
|
||||
@ -50,8 +50,8 @@ Its arguments are:
|
||||
.Bl -tag -width ".Fa mp"
|
||||
.It Fa mp
|
||||
The mount point to unbusy (unlock).
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Fa td
|
||||
The thread responsible for this call.
|
||||
.El
|
||||
.Sh LOCKS
|
||||
.Va mnt_lock
|
||||
|
@ -36,7 +36,7 @@
|
||||
.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"
|
||||
.Fn vinvalbuf "struct vnode *vp" "int flags" "struct ucred *cred" "struct thread *td" "int slpflag" "int slptimeo"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn vinvalbuf
|
||||
@ -62,8 +62,8 @@ The user credentials that are used to
|
||||
buffers if
|
||||
.Dv V_SAVE
|
||||
is set.
|
||||
.It Fa p
|
||||
The process responsible for this call.
|
||||
.It Fa td
|
||||
The thread responsible for this call.
|
||||
.It Fa slpflag
|
||||
The slp flag that will be used in the priority of any sleeps in the function.
|
||||
.It Fa slptimeo
|
||||
@ -78,9 +78,9 @@ must be held by prior to the call and remains locked upon return.
|
||||
A 0 value is returned on success.
|
||||
.Sh PSEUDOCODE
|
||||
.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);
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0);
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
if (error)
|
||||
return (error);
|
||||
.Ed
|
||||
|
Loading…
x
Reference in New Issue
Block a user