diff options
Diffstat (limited to 'include/linux/kobject_ns.h')
-rw-r--r-- | include/linux/kobject_ns.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h index 82cb5bf461fb..f66b065a8b5f 100644 --- a/include/linux/kobject_ns.h +++ b/include/linux/kobject_ns.h | |||
@@ -32,15 +32,17 @@ enum kobj_ns_type { | |||
32 | 32 | ||
33 | /* | 33 | /* |
34 | * Callbacks so sysfs can determine namespaces | 34 | * Callbacks so sysfs can determine namespaces |
35 | * @current_ns: return calling task's namespace | 35 | * @grab_current_ns: return a new reference to calling task's namespace |
36 | * @netlink_ns: return namespace to which a sock belongs (right?) | 36 | * @netlink_ns: return namespace to which a sock belongs (right?) |
37 | * @initial_ns: return the initial namespace (i.e. init_net_ns) | 37 | * @initial_ns: return the initial namespace (i.e. init_net_ns) |
38 | * @drop_ns: drops a reference to namespace | ||
38 | */ | 39 | */ |
39 | struct kobj_ns_type_operations { | 40 | struct kobj_ns_type_operations { |
40 | enum kobj_ns_type type; | 41 | enum kobj_ns_type type; |
41 | const void *(*current_ns)(void); | 42 | void *(*grab_current_ns)(void); |
42 | const void *(*netlink_ns)(struct sock *sk); | 43 | const void *(*netlink_ns)(struct sock *sk); |
43 | const void *(*initial_ns)(void); | 44 | const void *(*initial_ns)(void); |
45 | void (*drop_ns)(void *); | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); | 48 | int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); |
@@ -48,9 +50,9 @@ int kobj_ns_type_registered(enum kobj_ns_type type); | |||
48 | const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); | 50 | const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); |
49 | const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); | 51 | const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); |
50 | 52 | ||
51 | const void *kobj_ns_current(enum kobj_ns_type type); | 53 | void *kobj_ns_grab_current(enum kobj_ns_type type); |
52 | const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); | 54 | const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); |
53 | const void *kobj_ns_initial(enum kobj_ns_type type); | 55 | const void *kobj_ns_initial(enum kobj_ns_type type); |
54 | void kobj_ns_exit(enum kobj_ns_type type, const void *ns); | 56 | void kobj_ns_drop(enum kobj_ns_type type, void *ns); |
55 | 57 | ||
56 | #endif /* _LINUX_KOBJECT_NS_H */ | 58 | #endif /* _LINUX_KOBJECT_NS_H */ |