From 9273c09a1855c18d2128fe8a56b8f0b40078649d Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 22 Dec 2015 21:07:33 +0000 Subject: Fold lim_shared into lim_copy to mute a -Wunused compiler warning from clang when the kernel is compiled without INVARIANTS Differential Revision: https://reviews.freebsd.org/D4683 Reviewed by: kib, jhb MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- sys/kern/kern_resource.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sys/kern/kern_resource.c') diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 4edbcba..cbcd680 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -80,8 +80,6 @@ static int donice(struct thread *td, struct proc *chgp, int n); static struct uidinfo *uilookup(uid_t uid); static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); -static __inline int lim_shared(struct plimit *limp); - /* * Resource controls and accounting. */ @@ -1109,13 +1107,6 @@ lim_hold(struct plimit *limp) return (limp); } -static __inline int -lim_shared(struct plimit *limp) -{ - - return (limp->pl_refcnt > 1); -} - void lim_fork(struct proc *p1, struct proc *p2) { @@ -1146,7 +1137,7 @@ void lim_copy(struct plimit *dst, struct plimit *src) { - KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); + KASSERT(dst->pl_refcnt <= 1, ("lim_copy to shared limit")); bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit)); } -- cgit v1.1