Clarify what wapbl_jlock_assert and wapbl_junlock_assert mean.
This commit is contained in:
parent
e4264474cf
commit
51820012f4
@ -1,4 +1,4 @@
|
|||||||
.\" $NetBSD: wapbl.9,v 1.9 2015/03/31 00:03:58 riastradh Exp $
|
.\" $NetBSD: wapbl.9,v 1.10 2015/04/01 22:51:33 riastradh Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
|
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
@ -168,9 +168,9 @@ Either all writes issued between
|
|||||||
and
|
and
|
||||||
.Fn wapbl_end
|
.Fn wapbl_end
|
||||||
will complete, or none of them will.
|
will complete, or none of them will.
|
||||||
File systems can assert that the transaction should be locked with
|
File systems can assert that the transaction is locked with
|
||||||
.Fn wapbl_jlock_assert ,
|
.Fn wapbl_jlock_assert ,
|
||||||
or unlocked, with
|
or not exclusively locked, with
|
||||||
.Fn wapbl_junlock_assert .
|
.Fn wapbl_junlock_assert .
|
||||||
.Pp
|
.Pp
|
||||||
If a file system requires multiple transactions to initialize an
|
If a file system requires multiple transactions to initialize an
|
||||||
@ -399,8 +399,33 @@ that was given to
|
|||||||
.Fn wapbl_start .
|
.Fn wapbl_start .
|
||||||
.It Fn wapbl_jlock_assert wl
|
.It Fn wapbl_jlock_assert wl
|
||||||
Assert that the current transaction is locked.
|
Assert that the current transaction is locked.
|
||||||
|
.Pp
|
||||||
|
Note that it might not be locked by the current thread: this assertion
|
||||||
|
passes if
|
||||||
|
.Em any
|
||||||
|
thread has it locked.
|
||||||
.It Fn wapbl_junlock_assert wl
|
.It Fn wapbl_junlock_assert wl
|
||||||
Assert that the current transaction is unlocked.
|
Assert that the current transaction is not exclusively locked by the
|
||||||
|
current thread.
|
||||||
|
.Pp
|
||||||
|
Users of
|
||||||
|
.Nm
|
||||||
|
observe exclusive locks only in the
|
||||||
|
.Fa flushfn
|
||||||
|
and
|
||||||
|
.Fa flushabortfn
|
||||||
|
callbacks to
|
||||||
|
.Fn wapbl_start .
|
||||||
|
Outside of such contexts, the transaction is never exclusively locked,
|
||||||
|
even between
|
||||||
|
.Fn wapbl_begin
|
||||||
|
and
|
||||||
|
.Fn wapbl_end .
|
||||||
|
.Pp
|
||||||
|
There is no way to assert that the current transaction is not locked at
|
||||||
|
all -- i.e., that the caller may lock the transaction with
|
||||||
|
.Fn wapbl_begin
|
||||||
|
without danger of deadlock.
|
||||||
.El
|
.El
|
||||||
.Sh CODE REFERENCES
|
.Sh CODE REFERENCES
|
||||||
The
|
The
|
||||||
@ -465,6 +490,13 @@ occur in a single transaction -- there is no way to roll back the disk
|
|||||||
block allocations if the write fails in the middle, e.g. because of a
|
block allocations if the write fails in the middle, e.g. because of a
|
||||||
fault in the middle of the user buffer.
|
fault in the middle of the user buffer.
|
||||||
.Pp
|
.Pp
|
||||||
|
.Fn wapbl_jlock_assert
|
||||||
|
does not guarantee that the current thread has the current transaction
|
||||||
|
locked.
|
||||||
|
.Fn wapbl_junlock_assert
|
||||||
|
does not guarantee that the current thread does not have the current
|
||||||
|
transaction locked at all.
|
||||||
|
.Pp
|
||||||
There is only one
|
There is only one
|
||||||
.Nm
|
.Nm
|
||||||
transaction for each file system at any given time, and only one
|
transaction for each file system at any given time, and only one
|
||||||
|
Loading…
Reference in New Issue
Block a user