uipc_mqueue.c (90f580b954090e669da234f6c8e8d0379ff9d8bc) uipc_mqueue.c (25c2c952e3f64ec1a59033c0e2dc870a6c818a84)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
5 * Copyright (c) 2016-2017 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Portions of this software were developed by BAE Systems, the University of

--- 1548 unchanged lines hidden (view full) ---

1557
1558/*
1559 * See if this prison root is obsolete, and clean up associated queues if it is.
1560 */
1561static int
1562mqfs_prison_remove(void *obj, void *data __unused)
1563{
1564 const struct prison *pr = obj;
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
5 * Copyright (c) 2016-2017 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Portions of this software were developed by BAE Systems, the University of

--- 1548 unchanged lines hidden (view full) ---

1557
1558/*
1559 * See if this prison root is obsolete, and clean up associated queues if it is.
1560 */
1561static int
1562mqfs_prison_remove(void *obj, void *data __unused)
1563{
1564 const struct prison *pr = obj;
1565 const struct prison *tpr;
1565 struct prison *tpr;
1566 struct mqfs_node *pn, *tpn;
1567 int found;
1568
1569 found = 0;
1570 TAILQ_FOREACH(tpr, &allprison, pr_list) {
1566 struct mqfs_node *pn, *tpn;
1567 int found;
1568
1569 found = 0;
1570 TAILQ_FOREACH(tpr, &allprison, pr_list) {
1571 prison_lock(tpr);
1571 if (tpr->pr_root == pr->pr_root && tpr != pr && tpr->pr_ref > 0)
1572 found = 1;
1572 if (tpr->pr_root == pr->pr_root && tpr != pr && tpr->pr_ref > 0)
1573 found = 1;
1574 prison_unlock(tpr);
1573 }
1574 if (!found) {
1575 /*
1576 * No jails are rooted in this directory anymore,
1577 * so no queues should be either.
1578 */
1579 sx_xlock(&mqfs_data.mi_lock);
1580 LIST_FOREACH_SAFE(pn, &mqfs_data.mi_root->mn_children,

--- 1365 unchanged lines hidden ---
1575 }
1576 if (!found) {
1577 /*
1578 * No jails are rooted in this directory anymore,
1579 * so no queues should be either.
1580 */
1581 sx_xlock(&mqfs_data.mi_lock);
1582 LIST_FOREACH_SAFE(pn, &mqfs_data.mi_root->mn_children,

--- 1365 unchanged lines hidden ---