diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-02-16 17:25:24 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-02-16 17:25:24 +0100 |
commit | c6b80e99694002e17f8bca611cf3b4fac3ec75bb (patch) | |
tree | 815fec65f079b6fefb0e29b37145545f814c3b77 /security | |
parent | 0b10f83694ee9e092914a0e7a7d5561de190047e (diff) | |
parent | bc88c10d7e6900916f5e1ba3829d66a9de92b633 (diff) |
Merge branch 'locking/core'
Diffstat (limited to 'security')
-rw-r--r-- | security/apparmor/include/apparmor.h | 6 | ||||
-rw-r--r-- | security/apparmor/include/policy.h | 4 |
2 files changed, 2 insertions, 8 deletions
diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h index 5d721e990876..f067be814626 100644 --- a/security/apparmor/include/apparmor.h +++ b/security/apparmor/include/apparmor.h @@ -78,12 +78,6 @@ 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 diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h index 52275f040a5f..46467aaa557b 100644 --- a/security/apparmor/include/policy.h +++ b/security/apparmor/include/policy.h @@ -287,7 +287,7 @@ static inline struct aa_profile *aa_get_profile(struct aa_profile *p) */ static inline struct aa_profile *aa_get_profile_not0(struct aa_profile *p) { - if (p && kref_get_not0(&p->count)) + if (p && kref_get_unless_zero(&p->count)) return p; return NULL; @@ -307,7 +307,7 @@ static inline struct aa_profile *aa_get_profile_rcu(struct aa_profile __rcu **p) rcu_read_lock(); do { c = rcu_dereference(*p); - } while (c && !kref_get_not0(&c->count)); + } while (c && !kref_get_unless_zero(&c->count)); rcu_read_unlock(); return c; |