aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Le Hen <jlh@FreeBSD.org>2015-06-14 08:33:14 +0000
committerJeremie Le Hen <jlh@FreeBSD.org>2015-06-14 08:33:14 +0000
commit3768a5dfb578706668bd43355ff995439da7429d (patch)
treecde364bb6e1a291b770e0933d6442a4543ea4118
parentb7c4ed65cc940e4d9f548e6e5ed93acad5cc7099 (diff)
downloadsrc-3768a5dfb578706668bd43355ff995439da7429d.tar.gz
src-3768a5dfb578706668bd43355ff995439da7429d.zip
nit: Rename racct_alloc_resource to racct_adjust_resource.
This is more accurate as the amount can be negative. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=284378
-rw-r--r--sys/kern/kern_racct.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index e8ae9fef7646..2a1079084f39 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -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 resource, uint64_t amount)
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, int resource, uint64_t amount)
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 resource, uint64_t amount)
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 resource, uint64_t amount)
}
}
#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, int resource, uint64_t amount)
} 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, uint64_t amount)
"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, int resource, uint64_t amount)
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);
}
/*