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 a96da2559db2..7664d1b3d594 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -93,11 +93,8 @@ struct sysfs_dirent {
93#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) 93#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
94#define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR) 94#define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR)
95 95
96/* identify any namespace tag on sysfs_dirents */ 96#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
97#define SYSFS_NS_TYPE_MASK 0xf00 97#define SYSFS_FLAG_HAS_NS 0x01000
98#define SYSFS_NS_TYPE_SHIFT 8
99
100#define SYSFS_FLAG_MASK ~(SYSFS_NS_TYPE_MASK|SYSFS_TYPE_MASK)
101#define SYSFS_FLAG_REMOVED 0x02000 98#define SYSFS_FLAG_REMOVED 0x02000
102 99
103static inline unsigned int sysfs_type(struct sysfs_dirent *sd) 100static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
@@ -105,15 +102,6 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
105 return sd->s_flags & SYSFS_TYPE_MASK; 102 return sd->s_flags & SYSFS_TYPE_MASK;
106} 103}
107 104
108/*
109 * Return any namespace tags on this dirent.
110 * enum kobj_ns_type is defined in linux/kobject.h
111 */
112static inline enum kobj_ns_type sysfs_ns_type(struct sysfs_dirent *sd)
113{
114 return (sd->s_flags & SYSFS_NS_TYPE_MASK) >> SYSFS_NS_TYPE_SHIFT;
115}
116
117#ifdef CONFIG_DEBUG_LOCK_ALLOC 105#ifdef CONFIG_DEBUG_LOCK_ALLOC
118#define sysfs_dirent_init_lockdep(sd) \ 106#define sysfs_dirent_init_lockdep(sd) \
119do { \ 107do { \
@@ -141,12 +129,13 @@ struct sysfs_addrm_cxt {
141 */ 129 */
142 130
143/* 131/*
144 * Each sb is associated with a set of namespace tags (i.e. 132 * Each sb is associated with one namespace tag, currently the network
145 * the network namespace of the task which mounted this sysfs 133 * namespace of the task which mounted this sysfs instance. If multiple
146 * instance). 134 * tags become necessary, make the following an array and compare
135 * sysfs_dirent tag against every entry.
147 */ 136 */
148struct sysfs_super_info { 137struct sysfs_super_info {
149 void *ns[KOBJ_NS_TYPES]; 138 void *ns;
150}; 139};
151#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info)) 140#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
152extern struct sysfs_dirent sysfs_root; 141extern struct sysfs_dirent sysfs_root;