From 43c273489523fa39232b499ac547720f45dfffcf Mon Sep 17 00:00:00 2001 From: Jamie Gritton Date: Sat, 26 Dec 2020 17:01:16 -0800 Subject: [PATCH] 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 */