From owner-svn-src-all@FreeBSD.ORG Tue Mar 29 19:19:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3D4F106564A; Tue, 29 Mar 2011 19:19:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84F78FC0A; Tue, 29 Mar 2011 19:19:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2TJJAHW038498; Tue, 29 Mar 2011 19:19:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2TJJA0W038496; Tue, 29 Mar 2011 19:19:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103291919.p2TJJA0W038496@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Mar 2011 19:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220146 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 19:19:11 -0000 Author: trasz Date: Tue Mar 29 19:19:10 2011 New Revision: 220146 URL: http://svn.freebsd.org/changeset/base/220146 Log: Remove pointless (always true) KASSERTs. Submitted by: pjd Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue Mar 29 18:44:07 2011 (r220145) +++ head/sys/kern/kern_racct.c Tue Mar 29 19:19:10 2011 (r220146) @@ -285,8 +285,6 @@ racct_add(struct proc *p, int resource, * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(amount >= 0, ("racct_add: invalid amount for resource %d: %ju", - resource, amount)); mtx_lock(&racct_lock); #ifdef RCTL @@ -313,10 +311,6 @@ racct_add_cred_locked(struct ucred *cred SDT_PROBE(racct, kernel, rusage, add_cred, cred, resource, amount, 0, 0); - KASSERT(amount >= 0, - ("racct_add_cred: invalid amount for resource %d: %ju", - resource, amount)); - racct_alloc_resource(cred->cr_ruidinfo->ui_racct, resource, amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) racct_alloc_resource(pr->pr_racct, resource, amount); @@ -355,9 +349,6 @@ racct_add_force(struct proc *p, int reso * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(amount >= 0, - ("racct_add_force: invalid amount for resource %d: %ju", - resource, amount)); mtx_lock(&racct_lock); racct_alloc_resource(p->p_racct, resource, amount); @@ -382,8 +373,6 @@ racct_set_locked(struct proc *p, int res * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(amount >= 0, ("racct_set: invalid amount for resource %d: %ju", - resource, amount)); diff = amount - p->p_racct->r_resources[resource]; #ifdef notyet @@ -442,9 +431,6 @@ racct_set_force(struct proc *p, int reso * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(amount >= 0, - ("racct_set_force: invalid amount for resource %d: %ju", - resource, amount)); mtx_lock(&racct_lock); diff = amount - p->p_racct->r_resources[resource]; @@ -506,8 +492,6 @@ racct_sub(struct proc *p, int resource, * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(amount >= 0, ("racct_sub: invalid amount for resource %d: %ju", - resource, amount)); KASSERT(racct_is_reclaimable(resource), ("racct_sub: called for non-reclaimable resource %d", resource)); @@ -530,9 +514,6 @@ racct_sub_cred_locked(struct ucred *cred SDT_PROBE(racct, kernel, rusage, sub_cred, cred, resource, amount, 0, 0); - KASSERT(amount >= 0, - ("racct_sub_cred: invalid amount for resource %d: %ju", - resource, amount)); #ifdef notyet KASSERT(racct_is_reclaimable(resource), ("racct_sub_cred: called for non-reclaimable resource %d",