aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/racct.h
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2016-04-21 16:22:52 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2016-04-21 16:22:52 +0000
commitbbe4eb6d5427b8bbf0a9f4aaddcd56ba3ab1d425 (patch)
tree3bd1cbeca34794fd11d5f75c90c15f7a1f2d85d3 /sys/sys/racct.h
parent4a70acf1dc8a75c74f89af7a6698c7677dab8f85 (diff)
downloadsrc-bbe4eb6d5427b8bbf0a9f4aaddcd56ba3ab1d425.tar.gz
src-bbe4eb6d5427b8bbf0a9f4aaddcd56ba3ab1d425.zip
Get rid of rctl_lock; use racct_lock where appropriate. The fast paths
already required both of them, so having a separate rctl_lock didn't buy us anything. Reviewed by: mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5914
Notes
Notes: svn path=/head/; revision=298414
Diffstat (limited to 'sys/sys/racct.h')
-rw-r--r--sys/sys/racct.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/racct.h b/sys/sys/racct.h
index e50e7e67112c..9b8143f2a7cb 100644
--- a/sys/sys/racct.h
+++ b/sys/sys/racct.h
@@ -156,6 +156,12 @@ SYSCTL_DECL(_kern_racct);
#ifdef RACCT
+extern struct mtx racct_lock;
+
+#define RACCT_LOCK() mtx_lock(&racct_lock)
+#define RACCT_UNLOCK() mtx_unlock(&racct_lock)
+#define RACCT_LOCK_ASSERT() mtx_assert(&racct_lock, MA_OWNED)
+
int racct_add(struct proc *p, int resource, uint64_t amount);
void racct_add_cred(struct ucred *cred, int resource, uint64_t amount);
void racct_add_force(struct proc *p, int resource, uint64_t amount);