summaryrefslogtreecommitdiff
path: root/security/apparmor/include/apparmor.h
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2013-07-11 08:06:43 +0400
committerJohn Johansen <john.johansen@canonical.com>2013-08-14 22:42:06 +0400
commit01e2b670aa898a39259bc85c78e3d74820f4d3b6 (patch)
treecd78cea5f92788c213f2eb8ef287535ac1bb3327 /security/apparmor/include/apparmor.h
parentdd51c84857630e77c139afe4d9bba65fc051dc3f (diff)
downloadlinux-01e2b670aa898a39259bc85c78e3d74820f4d3b6.tar.xz
apparmor: convert profile lists to RCU based locking
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include/apparmor.h')
-rw-r--r--security/apparmor/include/apparmor.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h
index 1ba2ca56a6ef..8fb1488a3cd4 100644
--- a/security/apparmor/include/apparmor.h
+++ b/security/apparmor/include/apparmor.h
@@ -78,6 +78,12 @@ static inline void *kvzalloc(size_t size)
return __aa_kvmalloc(size, __GFP_ZERO);
}
+/* returns 0 if kref not incremented */
+static inline int kref_get_not0(struct kref *kref)
+{
+ return atomic_inc_not_zero(&kref->refcount);
+}
+
/**
* aa_strneq - compare null terminated @str to a non null terminated substring
* @str: a null terminated string