mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 06:44:31 +00:00
Some non-functional changes: whitespace, KASSERT strings, declaration order.
Approved by: bz (mentor)
This commit is contained in:
parent
b5260db685
commit
af7bd9a4f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191671
|
@ -121,13 +121,13 @@ int prisoncount = 0;
|
||||||
|
|
||||||
static void init_prison(void *);
|
static void init_prison(void *);
|
||||||
static void prison_complete(void *context, int pending);
|
static void prison_complete(void *context, int pending);
|
||||||
static int sysctl_jail_list(SYSCTL_HANDLER_ARGS);
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
static int _prison_check_ip4(struct prison *pr, struct in_addr *ia);
|
static int _prison_check_ip4(struct prison *pr, struct in_addr *ia);
|
||||||
#endif
|
#endif
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6);
|
static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6);
|
||||||
#endif
|
#endif
|
||||||
|
static int sysctl_jail_list(SYSCTL_HANDLER_ARGS);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_prison(void *data __unused)
|
init_prison(void *data __unused)
|
||||||
|
@ -765,7 +765,7 @@ prison_hold_locked(struct prison *pr)
|
||||||
|
|
||||||
mtx_assert(&pr->pr_mtx, MA_OWNED);
|
mtx_assert(&pr->pr_mtx, MA_OWNED);
|
||||||
KASSERT(pr->pr_ref > 0,
|
KASSERT(pr->pr_ref > 0,
|
||||||
("Trying to hold dead prison (id=%d).", pr->pr_id));
|
("Trying to hold dead prison (jid=%d).", pr->pr_id));
|
||||||
pr->pr_ref++;
|
pr->pr_ref++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,7 +784,8 @@ prison_proc_hold(struct prison *pr)
|
||||||
|
|
||||||
mtx_lock(&pr->pr_mtx);
|
mtx_lock(&pr->pr_mtx);
|
||||||
KASSERT(pr->pr_state == PRISON_STATE_ALIVE,
|
KASSERT(pr->pr_state == PRISON_STATE_ALIVE,
|
||||||
("Cannot add a process to a non-alive prison (id=%d).", pr->pr_id));
|
("Cannot add a process to a non-alive prison (jid=%d).",
|
||||||
|
pr->pr_id));
|
||||||
pr->pr_nprocs++;
|
pr->pr_nprocs++;
|
||||||
mtx_unlock(&pr->pr_mtx);
|
mtx_unlock(&pr->pr_mtx);
|
||||||
}
|
}
|
||||||
|
@ -795,7 +796,7 @@ prison_proc_free(struct prison *pr)
|
||||||
|
|
||||||
mtx_lock(&pr->pr_mtx);
|
mtx_lock(&pr->pr_mtx);
|
||||||
KASSERT(pr->pr_state == PRISON_STATE_ALIVE && pr->pr_nprocs > 0,
|
KASSERT(pr->pr_state == PRISON_STATE_ALIVE && pr->pr_nprocs > 0,
|
||||||
("Trying to kill a process in a dead prison (id=%d).", pr->pr_id));
|
("Trying to kill a process in a dead prison (jid=%d).", pr->pr_id));
|
||||||
pr->pr_nprocs--;
|
pr->pr_nprocs--;
|
||||||
if (pr->pr_nprocs == 0)
|
if (pr->pr_nprocs == 0)
|
||||||
pr->pr_state = PRISON_STATE_DYING;
|
pr->pr_state = PRISON_STATE_DYING;
|
||||||
|
@ -821,7 +822,6 @@ prison_get_ip4(struct ucred *cred, struct in_addr *ia)
|
||||||
KASSERT(ia != NULL, ("%s: ia is NULL", __func__));
|
KASSERT(ia != NULL, ("%s: ia is NULL", __func__));
|
||||||
|
|
||||||
if (!jailed(cred))
|
if (!jailed(cred))
|
||||||
/* Do not change address passed in. */
|
|
||||||
return (0);
|
return (0);
|
||||||
if (cred->cr_prison->pr_ip4 == NULL)
|
if (cred->cr_prison->pr_ip4 == NULL)
|
||||||
return (EAFNOSUPPORT);
|
return (EAFNOSUPPORT);
|
||||||
|
|
Loading…
Reference in a new issue