Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2011 19:19:10 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220146 - head/sys/kern
Message-ID:  <201103291919.p2TJJA0W038496@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103291919.p2TJJA0W038496>