diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-01-22 17:27:11 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-01-23 11:35:04 -0500 |
commit | 172856eac7cfaaeabad6a282d3c79d687ad69fc0 (patch) | |
tree | efe5a9d327c0b3e0c827ba49199e2e2e3142c16d /lib/kobject.c | |
parent | 052eac6eeb5655c52a490a49f09c55500f868558 (diff) |
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 <bart.vanassche@wdc.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 763d70a18941..06b849eee0ca 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -1039,6 +1039,7 @@ void *kobj_ns_grab_current(enum kobj_ns_type type) | |||
1039 | 1039 | ||
1040 | return ns; | 1040 | return ns; |
1041 | } | 1041 | } |
1042 | EXPORT_SYMBOL_GPL(kobj_ns_grab_current); | ||
1042 | 1043 | ||
1043 | const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk) | 1044 | const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk) |
1044 | { | 1045 | { |
@@ -1074,3 +1075,4 @@ void kobj_ns_drop(enum kobj_ns_type type, void *ns) | |||
1074 | kobj_ns_ops_tbl[type]->drop_ns(ns); | 1075 | kobj_ns_ops_tbl[type]->drop_ns(ns); |
1075 | spin_unlock(&kobj_ns_type_lock); | 1076 | spin_unlock(&kobj_ns_type_lock); |
1076 | } | 1077 | } |
1078 | EXPORT_SYMBOL_GPL(kobj_ns_drop); | ||