Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: cleanup unused functions in file.h

After changes in commit 33bf60cabcc7 ("LSM: Infrastructure management of
the file security"), aa_alloc_file_ctx() and aa_free_file_ctx() are no
longer used, so remove them, and also remove aa_get_file_label() because
it seems that it's never been used before.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Xiu Jianfeng and committed by
John Johansen
980a5808 9a0dbdbf

-37
-37
security/apparmor/include/file.h
··· 45 45 u32 allow; 46 46 }; 47 47 48 - /** 49 - * aa_alloc_file_ctx - allocate file_ctx 50 - * @label: initial label of task creating the file 51 - * @gfp: gfp flags for allocation 52 - * 53 - * Returns: file_ctx or NULL on failure 54 - */ 55 - static inline struct aa_file_ctx *aa_alloc_file_ctx(struct aa_label *label, 56 - gfp_t gfp) 57 - { 58 - struct aa_file_ctx *ctx; 59 - 60 - ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); 61 - if (ctx) { 62 - spin_lock_init(&ctx->lock); 63 - rcu_assign_pointer(ctx->label, aa_get_label(label)); 64 - } 65 - return ctx; 66 - } 67 - 68 - /** 69 - * aa_free_file_ctx - free a file_ctx 70 - * @ctx: file_ctx to free (MAYBE_NULL) 71 - */ 72 - static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) 73 - { 74 - if (ctx) { 75 - aa_put_label(rcu_access_pointer(ctx->label)); 76 - kfree_sensitive(ctx); 77 - } 78 - } 79 - 80 - static inline struct aa_label *aa_get_file_label(struct aa_file_ctx *ctx) 81 - { 82 - return aa_get_label_rcu(&ctx->label); 83 - } 84 - 85 48 /* 86 49 * The xindex is broken into 3 parts 87 50 * - index - an index into either the exec name table or the variable table