aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/sysfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r--fs/sysfs/sysfs.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 0af09fbfb3f6..e116c21a27bf 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -90,11 +90,8 @@ 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/* identify any namespace tag on sysfs_dirents */ 93#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
94#define SYSFS_NS_TYPE_MASK 0xf00 94#define SYSFS_FLAG_NS 0x01000
95#define SYSFS_NS_TYPE_SHIFT 8
96
97#define SYSFS_FLAG_MASK ~(SYSFS_NS_TYPE_MASK|SYSFS_TYPE_MASK)
98#define SYSFS_FLAG_REMOVED 0x02000 95#define SYSFS_FLAG_REMOVED 0x02000
99 96
100static inline unsigned int sysfs_type(struct sysfs_dirent *sd) 97static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
@@ -102,15 +99,6 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
102 return sd->s_flags & SYSFS_TYPE_MASK; 99 return sd->s_flags & SYSFS_TYPE_MASK;
103} 100}
104 101
105/*
106 * Return any namespace tags on this dirent.
107 * enum kobj_ns_type is defined in linux/kobject.h
108 */
109static 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
114#ifdef CONFIG_DEBUG_LOCK_ALLOC 102#ifdef CONFIG_DEBUG_LOCK_ALLOC
115 103
116#define sysfs_dirent_init_lockdep(sd) \ 104#define sysfs_dirent_init_lockdep(sd) \
@@ -155,12 +143,13 @@ struct sysfs_addrm_cxt {
155 */ 143 */
156 144
157/* 145/*
158 * Each sb is associated with a set of namespace tags (i.e. 146 * Each sb is associated with one namespace tag, currently the network
159 * the network namespace of the task which mounted this sysfs 147 * namespace of the task which mounted this sysfs instance. If multiple
160 * instance). 148 * tags become necessary, make the following an array and compare
149 * sysfs_dirent tag against every entry.
161 */ 150 */
162struct sysfs_super_info { 151struct sysfs_super_info {
163 void *ns[KOBJ_NS_TYPES]; 152 void *ns;
164}; 153};
165#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info)) 154#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
166extern struct sysfs_dirent sysfs_root; 155extern struct sysfs_dirent sysfs_root;