Skip to content

Commit 980a580

Browse files
Xiu Jianfengjrjohansen
authored andcommitted
apparmor: cleanup unused functions in file.h
After changes in commit 33bf60c ("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>
1 parent 9a0dbdb commit 980a580

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

  • security/apparmor/include

security/apparmor/include/file.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,43 +45,6 @@ struct aa_file_ctx {
4545
u32 allow;
4646
};
4747

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-
8548
/*
8649
* The xindex is broken into 3 parts
8750
* - index - an index into either the exec name table or the variable table

0 commit comments

Comments
 (0)