From owner-svn-src-head@freebsd.org Fri Apr 1 17:21:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB2BAEB9EE; Fri, 1 Apr 2016 17:21:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 84CDB15F3; Fri, 1 Apr 2016 17:21:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31HLtaw031558; Fri, 1 Apr 2016 17:21:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31HLt7k031557; Fri, 1 Apr 2016 17:21:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011721.u31HLt7k031557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297491 - 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.21 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: Fri, 01 Apr 2016 17:21:56 -0000 Author: trasz Date: Fri Apr 1 17:21:55 2016 New Revision: 297491 URL: https://svnweb.freebsd.org/changeset/base/297491 Log: Reorder the functions; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 17:17:32 2016 (r297490) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:21:55 2016 (r297491) @@ -582,6 +582,24 @@ racct_add(struct proc *p, int resource, return (error); } +/* + * Increase allocation of 'resource' by 'amount' for process 'p'. + * Doesn't check for limits and never fails. + */ +void +racct_add_force(struct proc *p, int resource, uint64_t amount) +{ + + if (!racct_enable) + return; + + SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); + + mtx_lock(&racct_lock); + racct_add_locked(p, resource, amount, 1); + mtx_unlock(&racct_lock); +} + static void racct_add_cred_locked(struct ucred *cred, int resource, uint64_t amount) { @@ -614,24 +632,6 @@ racct_add_cred(struct ucred *cred, int r mtx_unlock(&racct_lock); } -/* - * Increase allocation of 'resource' by 'amount' for process 'p'. - * Doesn't check for limits and never fails. - */ -void -racct_add_force(struct proc *p, int resource, uint64_t amount) -{ - - if (!racct_enable) - return; - - SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); - - mtx_lock(&racct_lock); - racct_add_locked(p, resource, amount, 1); - mtx_unlock(&racct_lock); -} - static int racct_set_locked(struct proc *p, int resource, uint64_t amount, int force) { @@ -688,20 +688,6 @@ racct_set_locked(struct proc *p, int res return (0); } -void -racct_set_force(struct proc *p, int resource, uint64_t amount) -{ - - if (!racct_enable) - return; - - SDT_PROBE3(racct, , rusage, set, p, resource, amount); - - mtx_lock(&racct_lock); - racct_set_locked(p, resource, amount, 1); - mtx_unlock(&racct_lock); -} - /* * Set allocation of 'resource' to 'amount' for process 'p'. * Return 0 if it's below limits, or errno, if it's not. @@ -725,6 +711,20 @@ racct_set(struct proc *p, int resource, return (error); } +void +racct_set_force(struct proc *p, int resource, uint64_t amount) +{ + + if (!racct_enable) + return; + + SDT_PROBE3(racct, , rusage, set, p, resource, amount); + + mtx_lock(&racct_lock); + racct_set_locked(p, resource, amount, 1); + mtx_unlock(&racct_lock); +} + /* * Returns amount of 'resource' the process 'p' can keep allocated. * Allocating more than that would be denied, unless the resource