aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kobject.h11
-rw-r--r--include/linux/sysfs.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index d9456f6..b60d2df 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -136,12 +136,23 @@ struct kobj_attribute {
extern const struct sysfs_ops kobj_sysfs_ops;
+/*
+ * Namespace types which are used to tag kobjects and sysfs entries.
+ * Network namespace will likely be the first.
+ */
enum kobj_ns_type {
KOBJ_NS_TYPE_NONE = 0,
KOBJ_NS_TYPES
};
struct sock;
+
+/*
+ * Callbacks so sysfs can determine namespaces
+ * @current_ns: return calling task's namespace
+ * @netlink_ns: return namespace to which a sock belongs (right?)
+ * @initial_ns: return the initial namespace (i.e. init_net_ns)
+ */
struct kobj_ns_type_operations {
enum kobj_ns_type type;
const void *(*current_ns)(void);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 976c466..47f1c95 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -178,6 +178,7 @@ struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
void sysfs_put(struct sysfs_dirent *sd);
void sysfs_printk_last_file(void);
+/* Called to clear a ns tag when it is no longer valid */
void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
int __must_check sysfs_init(void);