From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 08:33:15 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D9737E5; Sun, 14 Jun 2015 08:33:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB16A4F; Sun, 14 Jun 2015 08:33:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E8XE55053960; Sun, 14 Jun 2015 08:33:14 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5E8XE73053959; Sun, 14 Jun 2015 08:33:14 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201506140833.t5E8XE73053959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Sun, 14 Jun 2015 08:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284378 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 08:33:15 -0000 Author: jlh Date: Sun Jun 14 08:33:14 2015 New Revision: 284378 URL: https://svnweb.freebsd.org/changeset/base/284378 Log: nit: Rename racct_alloc_resource to racct_adjust_resource. This is more accurate as the amount can be negative. MFC after: 2 weeks Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sun Jun 14 07:47:18 2015 (r284377) +++ head/sys/kern/kern_racct.c Sun Jun 14 08:33:14 2015 (r284378) @@ -500,7 +500,7 @@ racct_destroy(struct racct **racct) * may be less than zero. */ static void -racct_alloc_resource(struct racct *racct, int resource, +racct_adjust_resource(struct racct *racct, int resource, uint64_t amount) { @@ -553,7 +553,7 @@ racct_add_locked(struct proc *p, int res return (error); } #endif - racct_alloc_resource(p->p_racct, resource, amount); + racct_adjust_resource(p->p_racct, resource, amount); racct_add_cred_locked(p->p_ucred, resource, amount); return (0); @@ -587,11 +587,11 @@ racct_add_cred_locked(struct ucred *cred SDT_PROBE(racct, kernel, rusage, add__cred, cred, resource, amount, 0, 0); - racct_alloc_resource(cred->cr_ruidinfo->ui_racct, resource, amount); + racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) - racct_alloc_resource(pr->pr_prison_racct->prr_racct, resource, + racct_adjust_resource(pr->pr_prison_racct->prr_racct, resource, amount); - racct_alloc_resource(cred->cr_loginclass->lc_racct, resource, amount); + racct_adjust_resource(cred->cr_loginclass->lc_racct, resource, amount); } /* @@ -631,7 +631,7 @@ racct_add_force(struct proc *p, int reso PROC_LOCK_ASSERT(p, MA_OWNED); mtx_lock(&racct_lock); - racct_alloc_resource(p->p_racct, resource, amount); + racct_adjust_resource(p->p_racct, resource, amount); mtx_unlock(&racct_lock); racct_add_cred(p->p_ucred, resource, amount); } @@ -685,7 +685,7 @@ racct_set_locked(struct proc *p, int res } } #endif - racct_alloc_resource(p->p_racct, resource, diff_proc); + racct_adjust_resource(p->p_racct, resource, diff_proc); if (diff_cred > 0) racct_add_cred_locked(p->p_ucred, resource, diff_cred); else if (diff_cred < 0) @@ -747,7 +747,7 @@ racct_set_force_locked(struct proc *p, i } else diff_cred = diff_proc; - racct_alloc_resource(p->p_racct, resource, diff_proc); + racct_adjust_resource(p->p_racct, resource, diff_proc); if (diff_cred > 0) racct_add_cred_locked(p->p_ucred, resource, diff_cred); else if (diff_cred < 0) @@ -849,7 +849,7 @@ racct_sub(struct proc *p, int resource, "than allocated %jd for %s (pid %d)", __func__, amount, resource, (intmax_t)p->p_racct->r_resources[resource], p->p_comm, p->p_pid)); - racct_alloc_resource(p->p_racct, resource, -amount); + racct_adjust_resource(p->p_racct, resource, -amount); racct_sub_cred_locked(p->p_ucred, resource, amount); mtx_unlock(&racct_lock); } @@ -870,11 +870,11 @@ racct_sub_cred_locked(struct ucred *cred resource)); #endif - racct_alloc_resource(cred->cr_ruidinfo->ui_racct, resource, -amount); + racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, -amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) - racct_alloc_resource(pr->pr_prison_racct->prr_racct, resource, + racct_adjust_resource(pr->pr_prison_racct->prr_racct, resource, -amount); - racct_alloc_resource(cred->cr_loginclass->lc_racct, resource, -amount); + racct_adjust_resource(cred->cr_loginclass->lc_racct, resource, -amount); } /*