diff options
author | John Johansen <john.johansen@canonical.com> | 2017-06-09 11:43:45 -0700 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2017-06-10 17:11:37 -0700 |
commit | 2835a13bbdc09d330eafdf5e67eb407c90c01ab7 (patch) | |
tree | 03a6a71e39a2fcac5c777cbf86928961285302d9 /security/apparmor/include/file.h | |
parent | df8073c67fd8acb7e79f203ba4c0fa456bb82762 (diff) |
apparmor: cleanup rename XXX_file_context() to XXX_file_ctx()
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include/file.h')
-rw-r--r-- | security/apparmor/include/file.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h index 365ca7ead133..19c483850770 100644 --- a/security/apparmor/include/file.h +++ b/security/apparmor/include/file.h @@ -30,6 +30,8 @@ struct path; AA_MAY_CHMOD | AA_MAY_CHOWN | AA_MAY_LOCK | \ AA_EXEC_MMAP | AA_MAY_LINK) +#define file_ctx(X) ((struct aa_file_ctx *)(X)->f_security) + /* struct aa_file_ctx - the AppArmor context the file was opened in * @perms: the permission the file was opened with * @@ -42,21 +44,26 @@ struct aa_file_ctx { }; /** - * aa_alloc_file_context - allocate file_ctx + * aa_alloc_file_ctx - allocate file_ctx + * @label: initial label of task creating the file * @gfp: gfp flags for allocation * * Returns: file_ctx or NULL on failure */ -static inline struct aa_file_ctx *aa_alloc_file_context(gfp_t gfp) +static inline struct aa_file_ctx *aa_alloc_file_ctx(gfp_t gfp) { - return kzalloc(sizeof(struct aa_file_ctx), gfp); + struct aa_file_ctx *ctx; + + ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); + + return ctx; } /** - * aa_free_file_context - free a file_ctx + * aa_free_file_ctx - free a file_ctx * @ctx: file_ctx to free (MAYBE_NULL) */ -static inline void aa_free_file_context(struct aa_file_ctx *ctx) +static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) { if (ctx) kzfree(ctx); |