Skip to content

Commit 172856e

Browse files
KAGA-KOKOdledford
authored andcommitted
kobject: Export kobj_ns_grab_current() and kobj_ns_drop()
Make it possible to call these two functions from a kernel module. Note: despite their name, these two functions can be used meaningfully independent of kobjects. A later patch will add calls to these functions from the SRP driver because this patch series modifies the SRP driver such that it can hold a reference to a namespace that can last longer than the lifetime of the process through which the namespace reference was obtained. Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 052eac6 commit 172856e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/kobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,7 @@ void *kobj_ns_grab_current(enum kobj_ns_type type)
10391039

10401040
return ns;
10411041
}
1042+
EXPORT_SYMBOL_GPL(kobj_ns_grab_current);
10421043

10431044
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk)
10441045
{
@@ -1074,3 +1075,4 @@ void kobj_ns_drop(enum kobj_ns_type type, void *ns)
10741075
kobj_ns_ops_tbl[type]->drop_ns(ns);
10751076
spin_unlock(&kobj_ns_type_lock);
10761077
}
1078+
EXPORT_SYMBOL_GPL(kobj_ns_drop);

0 commit comments

Comments
 (0)