HomeFreeBSD

jail: Use refcount(9) for prison references.

Description

jail: Use refcount(9) for prison references.

Use refcount(9) for both pr_ref and pr_uref in struct prison. This
allows prisons to held and freed without requiring the prison mutex.
An exception to this is that dropping the last reference will still
lock the prison, to keep the guarantee that a locked prison remains
valid and alive (provided it was at the time it was locked).

Among other things, this honors the promise made in a comment in
crcopy(9), that it will not block, which hasn't been true for two
decades.

Details

Provenance
jamieAuthored on Jan 20 2021, 11:08 PM
Parents
rGe3dd8ed77b4e: devinfo sysctl handler: Do not write zero-length strings in to sbuf twice
Branches
Unknown
Tags
Unknown