diff options
Diffstat (limited to 'lib/kobject.c')
| -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 4a1f33d43548..3bbde222c90f 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
| @@ -915,6 +915,21 @@ const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj) | |||
| 915 | return kobj_child_ns_ops(kobj->parent); | 915 | return kobj_child_ns_ops(kobj->parent); |
| 916 | } | 916 | } |
| 917 | 917 | ||
| 918 | bool kobj_ns_current_may_mount(enum kobj_ns_type type) | ||
| 919 | { | ||
| 920 | bool may_mount = false; | ||
| 921 | |||
| 922 | if (type == KOBJ_NS_TYPE_NONE) | ||
| 923 | return true; | ||
| 924 | |||
| 925 | spin_lock(&kobj_ns_type_lock); | ||
| 926 | if ((type > KOBJ_NS_TYPE_NONE) && (type < KOBJ_NS_TYPES) && | ||
| 927 | kobj_ns_ops_tbl[type]) | ||
| 928 | may_mount = kobj_ns_ops_tbl[type]->current_may_mount(); | ||
| 929 | spin_unlock(&kobj_ns_type_lock); | ||
| 930 | |||
| 931 | return may_mount; | ||
| 932 | } | ||
| 918 | 933 | ||
| 919 | void *kobj_ns_grab_current(enum kobj_ns_type type) | 934 | void *kobj_ns_grab_current(enum kobj_ns_type type) |
| 920 | { | 935 | { |
