Skip to content

Commit fee5304

Browse files
Xiu Jianfengjrjohansen
authored andcommitted
apparmor: remove unused functions in policy_ns.c/.h
These functions are not used now, remove them. Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 5ebb39e commit fee5304

2 files changed

Lines changed: 0 additions & 51 deletions

File tree

security/apparmor/include/policy_ns.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ const char *aa_ns_name(struct aa_ns *parent, struct aa_ns *child, bool subns);
8686
void aa_free_ns(struct aa_ns *ns);
8787
int aa_alloc_root_ns(void);
8888
void aa_free_root_ns(void);
89-
void aa_free_ns_kref(struct kref *kref);
9089

91-
struct aa_ns *aa_find_ns(struct aa_ns *root, const char *name);
92-
struct aa_ns *aa_findn_ns(struct aa_ns *root, const char *name, size_t n);
9390
struct aa_ns *__aa_lookupn_ns(struct aa_ns *view, const char *hname, size_t n);
9491
struct aa_ns *aa_lookupn_ns(struct aa_ns *view, const char *name, size_t n);
9592
struct aa_ns *__aa_find_or_create_ns(struct aa_ns *parent, const char *name,
@@ -151,15 +148,4 @@ static inline struct aa_ns *__aa_find_ns(struct list_head *head,
151148
return __aa_findn_ns(head, name, strlen(name));
152149
}
153150

154-
static inline struct aa_ns *__aa_lookup_ns(struct aa_ns *base,
155-
const char *hname)
156-
{
157-
return __aa_lookupn_ns(base, hname, strlen(hname));
158-
}
159-
160-
static inline struct aa_ns *aa_lookup_ns(struct aa_ns *view, const char *name)
161-
{
162-
return aa_lookupn_ns(view, name, strlen(name));
163-
}
164-
165151
#endif /* AA_NAMESPACE_H */

security/apparmor/policy_ns.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -159,43 +159,6 @@ void aa_free_ns(struct aa_ns *ns)
159159
kfree_sensitive(ns);
160160
}
161161

162-
/**
163-
* aa_findn_ns - look up a profile namespace on the namespace list
164-
* @root: namespace to search in (NOT NULL)
165-
* @name: name of namespace to find (NOT NULL)
166-
* @n: length of @name
167-
*
168-
* Returns: a refcounted namespace on the list, or NULL if no namespace
169-
* called @name exists.
170-
*
171-
* refcount released by caller
172-
*/
173-
struct aa_ns *aa_findn_ns(struct aa_ns *root, const char *name, size_t n)
174-
{
175-
struct aa_ns *ns = NULL;
176-
177-
rcu_read_lock();
178-
ns = aa_get_ns(__aa_findn_ns(&root->sub_ns, name, n));
179-
rcu_read_unlock();
180-
181-
return ns;
182-
}
183-
184-
/**
185-
* aa_find_ns - look up a profile namespace on the namespace list
186-
* @root: namespace to search in (NOT NULL)
187-
* @name: name of namespace to find (NOT NULL)
188-
*
189-
* Returns: a refcounted namespace on the list, or NULL if no namespace
190-
* called @name exists.
191-
*
192-
* refcount released by caller
193-
*/
194-
struct aa_ns *aa_find_ns(struct aa_ns *root, const char *name)
195-
{
196-
return aa_findn_ns(root, name, strlen(name));
197-
}
198-
199162
/**
200163
* __aa_lookupn_ns - lookup the namespace matching @hname
201164
* @view: namespace to search in (NOT NULL)

0 commit comments

Comments
 (0)