diff options
author | John Johansen <john.johansen@canonical.com> | 2013-02-18 19:04:34 -0500 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2013-04-28 03:36:09 -0400 |
commit | 0ca554b9fca425eb58325a36290deef698cef34b (patch) | |
tree | aa9cd7544db53f617f8bf6b0e441f97a55ed4181 /security/apparmor/include | |
parent | 3cfcc19e0b5390c04cb5bfa4e8fde39395410e61 (diff) |
apparmor: add kvzalloc to handle zeroing for kvmalloc
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
Diffstat (limited to 'security/apparmor/include')
-rw-r--r-- | security/apparmor/include/apparmor.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h index 40aedd9f73ea..1ba2ca56a6ef 100644 --- a/security/apparmor/include/apparmor.h +++ b/security/apparmor/include/apparmor.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #ifndef __APPARMOR_H | 15 | #ifndef __APPARMOR_H |
16 | #define __APPARMOR_H | 16 | #define __APPARMOR_H |
17 | 17 | ||
18 | #include <linux/slab.h> | ||
18 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
19 | 20 | ||
20 | #include "match.h" | 21 | #include "match.h" |
@@ -64,9 +65,18 @@ extern int apparmor_initialized __initdata; | |||
64 | /* fn's in lib */ | 65 | /* fn's in lib */ |
65 | char *aa_split_fqname(char *args, char **ns_name); | 66 | char *aa_split_fqname(char *args, char **ns_name); |
66 | void aa_info_message(const char *str); | 67 | void aa_info_message(const char *str); |
67 | void *kvmalloc(size_t size); | 68 | void *__aa_kvmalloc(size_t size, gfp_t flags); |
68 | void kvfree(void *buffer); | 69 | void kvfree(void *buffer); |
69 | 70 | ||
71 | static inline void *kvmalloc(size_t size) | ||
72 | { | ||
73 | return __aa_kvmalloc(size, 0); | ||
74 | } | ||
75 | |||
76 | static inline void *kvzalloc(size_t size) | ||
77 | { | ||
78 | return __aa_kvmalloc(size, __GFP_ZERO); | ||
79 | } | ||
70 | 80 | ||
71 | /** | 81 | /** |
72 | * aa_strneq - compare null terminated @str to a non null terminated substring | 82 | * aa_strneq - compare null terminated @str to a non null terminated substring |