HomeFreeBSD

jail: Fix an O(n^2) loop when adding jails

Description

jail: Fix an O(n^2) loop when adding jails

When a jail is added using the default (system-chosen) JID, and
non-default-JID jails already exist, a loop through the allprison
list could restart and result in unnecessary O(n^2) behaviour.
There should never be more than two list passes required.

Also clean up inefficient (though still O(n)) allprison list traversal
when finding jails by ID, or when adding jails in the common case of
all default JIDs.

Details

Provenance
jamieAuthored on Dec 26 2020, 6:39 PM
Parents
rGb9cbd68d1cbb: ARM: Enhance common Nvidia Tegra drivers by support for Tegra210 SoC.
Branches
Unknown
Tags
Unknown