diff options
Diffstat (limited to 'sys/sys/jail.h')
-rw-r--r-- | sys/sys/jail.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 67ef9347d093..2d1a26787b99 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -150,17 +150,18 @@ struct prison_racct; * * Lock key: * (a) allprison_lock + * (c) set only during creation before the structure is shared, no mutex + * required to read * (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 + * (r) atomic via refcount(9), pr_mtx required to decrement to zero */ struct prison { TAILQ_ENTRY(prison) pr_list; /* (a) all prisons */ int pr_id; /* (c) prison id */ - int pr_ref; /* (m) refcount */ - int pr_uref; /* (m) user (alive) refcount */ + volatile u_int pr_ref; /* (r) refcount */ + volatile u_int pr_uref; /* (r) 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 */ |