git: 43c273489523 - main - jail: Make comments on struct prison locking more precise
Jamie Gritton
jamie at FreeBSD.org
Sun Dec 27 01:01:33 UTC 2020
The branch main has been updated by jamie:
URL: https://cgit.FreeBSD.org/src/commit/?id=43c273489523fa39232b499ac547720f45dfffcf
commit 43c273489523fa39232b499ac547720f45dfffcf
Author: Jamie Gritton <jamie at FreeBSD.org>
AuthorDate: 2020-12-27 01:01:16 +0000
Commit: Jamie Gritton <jamie at FreeBSD.org>
CommitDate: 2020-12-27 01:01:16 +0000
jail: Make comments on struct prison locking more precise
---
sys/sys/jail.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sys/sys/jail.h b/sys/sys/jail.h
index 2a6ee07ecc47..b95406079ea1 100644
--- a/sys/sys/jail.h
+++ b/sys/sys/jail.h
@@ -150,15 +150,17 @@ struct prison_racct;
*
* Lock key:
* (a) allprison_lock
- * (p) locked by pr_mtx
+ * (m) locked by pr_mtx
+ * (p) locked by pr_mtx, and also at least shared allprison_lock required
+ * to update
* (c) set only during creation before the structure is shared, no mutex
* required to read
*/
struct prison {
TAILQ_ENTRY(prison) pr_list; /* (a) all prisons */
int pr_id; /* (c) prison id */
- int pr_ref; /* (p) refcount */
- int pr_uref; /* (p) user (alive) refcount */
+ int pr_ref; /* (m) refcount */
+ int pr_uref; /* (m) user (alive) refcount */
unsigned pr_flags; /* (p) PR_* flags */
LIST_HEAD(, prison) pr_children; /* (a) list of child jails */
LIST_ENTRY(prison) pr_sibling; /* (a) next in parent's list */
More information about the dev-commits-src-main
mailing list