diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-07 06:47:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-07 06:47:28 -0500 |
commit | a1212d278c05ca0a38f5cbd7ae90ac2e367228a8 (patch) | |
tree | 230f8bad53644f1bdd25e5c0fd892475742e7783 /fs/sysfs/sysfs.h | |
parent | 0b1e73ed225d8f7aeef96b74147215ca8b990dce (diff) |
Revert "sysfs: drop kobj_ns_type handling"
This reverts commit cb26a311578e67769e92a39a0a63476533cb7e12.
It mysteriously causes NetworkManager to not find the wireless device
for me. As far as I can tell, Tejun *meant* for this commit to not make
any semantic changes, but there clearly are some. So revert it, taking
into account some of the calling convention changes that happened in
this area in subsequent commits.
Cc: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r-- | fs/sysfs/sysfs.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index e3aea92ebfa3..0af09fbfb3f6 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -90,8 +90,11 @@ struct sysfs_dirent { | |||
90 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) | 90 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) |
91 | #define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR) | 91 | #define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR) |
92 | 92 | ||
93 | #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK | 93 | /* identify any namespace tag on sysfs_dirents */ |
94 | #define SYSFS_FLAG_HAS_NS 0x01000 | 94 | #define SYSFS_NS_TYPE_MASK 0xf00 |
95 | #define SYSFS_NS_TYPE_SHIFT 8 | ||
96 | |||
97 | #define SYSFS_FLAG_MASK ~(SYSFS_NS_TYPE_MASK|SYSFS_TYPE_MASK) | ||
95 | #define SYSFS_FLAG_REMOVED 0x02000 | 98 | #define SYSFS_FLAG_REMOVED 0x02000 |
96 | 99 | ||
97 | static inline unsigned int sysfs_type(struct sysfs_dirent *sd) | 100 | static inline unsigned int sysfs_type(struct sysfs_dirent *sd) |
@@ -99,6 +102,15 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd) | |||
99 | return sd->s_flags & SYSFS_TYPE_MASK; | 102 | return sd->s_flags & SYSFS_TYPE_MASK; |
100 | } | 103 | } |
101 | 104 | ||
105 | /* | ||
106 | * Return any namespace tags on this dirent. | ||
107 | * enum kobj_ns_type is defined in linux/kobject.h | ||
108 | */ | ||
109 | static inline enum kobj_ns_type sysfs_ns_type(struct sysfs_dirent *sd) | ||
110 | { | ||
111 | return (sd->s_flags & SYSFS_NS_TYPE_MASK) >> SYSFS_NS_TYPE_SHIFT; | ||
112 | } | ||
113 | |||
102 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 114 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
103 | 115 | ||
104 | #define sysfs_dirent_init_lockdep(sd) \ | 116 | #define sysfs_dirent_init_lockdep(sd) \ |
@@ -143,13 +155,12 @@ struct sysfs_addrm_cxt { | |||
143 | */ | 155 | */ |
144 | 156 | ||
145 | /* | 157 | /* |
146 | * Each sb is associated with one namespace tag, currently the network | 158 | * Each sb is associated with a set of namespace tags (i.e. |
147 | * namespace of the task which mounted this sysfs instance. If multiple | 159 | * the network namespace of the task which mounted this sysfs |
148 | * tags become necessary, make the following an array and compare | 160 | * instance). |
149 | * sysfs_dirent tag against every entry. | ||
150 | */ | 161 | */ |
151 | struct sysfs_super_info { | 162 | struct sysfs_super_info { |
152 | void *ns; | 163 | void *ns[KOBJ_NS_TYPES]; |
153 | }; | 164 | }; |
154 | #define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info)) | 165 | #define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info)) |
155 | extern struct sysfs_dirent sysfs_root; | 166 | extern struct sysfs_dirent sysfs_root; |