Date: Fri, 1 Apr 2016 17:21:55 +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: r297491 - head/sys/kern Message-ID: <201604011721.u31HLt7k031557@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604011721.u31HLt7k031557>