diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/kobject.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 1d46c151a4ae..962175134702 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
| @@ -931,6 +931,21 @@ const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj) | |||
| 931 | return kobj_child_ns_ops(kobj->parent); | 931 | return kobj_child_ns_ops(kobj->parent); |
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | bool kobj_ns_current_may_mount(enum kobj_ns_type type) | ||
| 935 | { | ||
| 936 | bool may_mount = false; | ||
| 937 | |||
| 938 | if (type == KOBJ_NS_TYPE_NONE) | ||
| 939 | return true; | ||
| 940 | |||
| 941 | spin_lock(&kobj_ns_type_lock); | ||
| 942 | if ((type > KOBJ_NS_TYPE_NONE) && (type < KOBJ_NS_TYPES) && | ||
| 943 | kobj_ns_ops_tbl[type]) | ||
| 944 | may_mount = kobj_ns_ops_tbl[type]->current_may_mount(); | ||
| 945 | spin_unlock(&kobj_ns_type_lock); | ||
| 946 | |||
| 947 | return may_mount; | ||
| 948 | } | ||
| 934 | 949 | ||
| 935 | void *kobj_ns_grab_current(enum kobj_ns_type type) | 950 | void *kobj_ns_grab_current(enum kobj_ns_type type) |
| 936 | { | 951 | { |
