Skip to content

Commit

Permalink
kobject: Remove unused functions
Browse files Browse the repository at this point in the history
kobj_ns_initial() and kobj_ns_netlink() were adde din 2010 by
commit bc451f2 ("kobj: Add basic infrastructure for dealing with
namespaces.")
but have remained unused.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dr. David Alan Gilbert authored and gregkh committed Jan 14, 2025
1 parent dd19f41 commit ee9c693
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
2 changes: 0 additions & 2 deletions include/linux/kobject_ns.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ const struct kobj_ns_type_operations *kobj_ns_ops(const struct kobject *kobj);

bool kobj_ns_current_may_mount(enum kobj_ns_type type);
void *kobj_ns_grab_current(enum kobj_ns_type type);
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
const void *kobj_ns_initial(enum kobj_ns_type type);
void kobj_ns_drop(enum kobj_ns_type type, void *ns);

#endif /* _LINUX_KOBJECT_NS_H */
24 changes: 0 additions & 24 deletions lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,30 +1096,6 @@ void *kobj_ns_grab_current(enum kobj_ns_type type)
}
EXPORT_SYMBOL_GPL(kobj_ns_grab_current);

const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk)
{
const void *ns = NULL;

spin_lock(&kobj_ns_type_lock);
if (kobj_ns_type_is_valid(type) && kobj_ns_ops_tbl[type])
ns = kobj_ns_ops_tbl[type]->netlink_ns(sk);
spin_unlock(&kobj_ns_type_lock);

return ns;
}

const void *kobj_ns_initial(enum kobj_ns_type type)
{
const void *ns = NULL;

spin_lock(&kobj_ns_type_lock);
if (kobj_ns_type_is_valid(type) && kobj_ns_ops_tbl[type])
ns = kobj_ns_ops_tbl[type]->initial_ns();
spin_unlock(&kobj_ns_type_lock);

return ns;
}

void kobj_ns_drop(enum kobj_ns_type type, void *ns)
{
spin_lock(&kobj_ns_type_lock);
Expand Down

0 comments on commit ee9c693

Please sign in to comment.