diff options
| author | Serge E. Hallyn <serue@us.ibm.com> | 2010-05-03 17:23:15 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-21 12:37:31 -0400 |
| commit | be867b194a3ae3c680c29521287ae49b4d44d420 (patch) | |
| tree | 1b3ad125d02603c6a9cc4bb8ae518695d7c6a66d /include/linux | |
| parent | f349cf34731c3b3eddbcd63cb04489aee2c405bd (diff) | |
sysfs: Comment sysfs directory tagging logic
Add some in-line comments to explain the new infrastructure, which
was introduced to support sysfs directory tagging with namespaces.
I think an overall description someplace might be good too, but it
didn't really seem to fit into Documentation/filesystems/sysfs.txt,
which appears more geared toward users, rather than maintainers, of
sysfs.
(Tejun, please let me know if I can make anything clearer or failed
altogether to comment something that should be commented.)
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kobject.h | 11 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index d9456f69904f..b60d2dfe4e69 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -136,12 +136,23 @@ struct kobj_attribute { | |||
| 136 | 136 | ||
| 137 | extern const struct sysfs_ops kobj_sysfs_ops; | 137 | extern const struct sysfs_ops kobj_sysfs_ops; |
| 138 | 138 | ||
| 139 | /* | ||
| 140 | * Namespace types which are used to tag kobjects and sysfs entries. | ||
| 141 | * Network namespace will likely be the first. | ||
| 142 | */ | ||
| 139 | enum kobj_ns_type { | 143 | enum kobj_ns_type { |
| 140 | KOBJ_NS_TYPE_NONE = 0, | 144 | KOBJ_NS_TYPE_NONE = 0, |
| 141 | KOBJ_NS_TYPES | 145 | KOBJ_NS_TYPES |
| 142 | }; | 146 | }; |
| 143 | 147 | ||
| 144 | struct sock; | 148 | struct sock; |
| 149 | |||
| 150 | /* | ||
| 151 | * Callbacks so sysfs can determine namespaces | ||
| 152 | * @current_ns: return calling task's namespace | ||
| 153 | * @netlink_ns: return namespace to which a sock belongs (right?) | ||
| 154 | * @initial_ns: return the initial namespace (i.e. init_net_ns) | ||
| 155 | */ | ||
| 145 | struct kobj_ns_type_operations { | 156 | struct kobj_ns_type_operations { |
| 146 | enum kobj_ns_type type; | 157 | enum kobj_ns_type type; |
| 147 | const void *(*current_ns)(void); | 158 | const void *(*current_ns)(void); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 976c4664b216..47f1c95b5298 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -178,6 +178,7 @@ struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | |||
| 178 | void sysfs_put(struct sysfs_dirent *sd); | 178 | void sysfs_put(struct sysfs_dirent *sd); |
| 179 | void sysfs_printk_last_file(void); | 179 | void sysfs_printk_last_file(void); |
| 180 | 180 | ||
| 181 | /* Called to clear a ns tag when it is no longer valid */ | ||
| 181 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); | 182 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); |
| 182 | 183 | ||
| 183 | int __must_check sysfs_init(void); | 184 | int __must_check sysfs_init(void); |
