diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 14:54:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-29 20:41:35 -0500 |
commit | a7dc66dfb4c6d6c1d7c14d5106ce467f1dbd4eba (patch) | |
tree | 013752fe5b620dd8bda9318bd1156941c5995de3 /fs/sysfs/sysfs.h | |
parent | 471bd7b78bd56c580e91e00a0f656ca922ab3b3c (diff) |
sysfs, kernfs: remove SYSFS_KOBJ_BIN_ATTR
After kernfs_ops and sysfs_dirent->s_attr.size addition, the
distinction between SYSFS_KOBJ_BIN_ATTR and SYSFS_KOBJ_ATTR is only
necessary while creating files to decide which kernfs_ops to use.
Afterwards, they behave exactly the same.
This patch removes SYSFS_KOBJ_BIN_ATTR along with sysfs_is_bin().
sysfs_add_file[_mode_ns]() are updated to take bool @is_bin instead of
@type.
This patch doesn't introduce any behavior changes. This completely
isolates the distinction between the two sysfs file types in the sysfs
layer proper.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r-- | fs/sysfs/sysfs.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index d40e85e8c2ee..28898fa551c6 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -83,10 +83,9 @@ struct sysfs_dirent { | |||
83 | #define SYSFS_TYPE_MASK 0x00ff | 83 | #define SYSFS_TYPE_MASK 0x00ff |
84 | #define SYSFS_DIR 0x0001 | 84 | #define SYSFS_DIR 0x0001 |
85 | #define SYSFS_KOBJ_ATTR 0x0002 | 85 | #define SYSFS_KOBJ_ATTR 0x0002 |
86 | #define SYSFS_KOBJ_BIN_ATTR 0x0004 | ||
87 | #define SYSFS_KOBJ_LINK 0x0008 | 86 | #define SYSFS_KOBJ_LINK 0x0008 |
88 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) | 87 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) |
89 | #define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR) | 88 | #define SYSFS_ACTIVE_REF SYSFS_KOBJ_ATTR |
90 | 89 | ||
91 | #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK | 90 | #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK |
92 | #define SYSFS_FLAG_NS 0x01000 | 91 | #define SYSFS_FLAG_NS 0x01000 |
@@ -115,10 +114,8 @@ do { \ | |||
115 | static inline bool sysfs_ignore_lockdep(struct sysfs_dirent *sd) | 114 | static inline bool sysfs_ignore_lockdep(struct sysfs_dirent *sd) |
116 | { | 115 | { |
117 | struct attribute *attr = sd->priv; | 116 | struct attribute *attr = sd->priv; |
118 | int type = sysfs_type(sd); | ||
119 | 117 | ||
120 | return (type == SYSFS_KOBJ_ATTR || type == SYSFS_KOBJ_BIN_ATTR) && | 118 | return sysfs_type(sd) == SYSFS_KOBJ_ATTR && attr->ignore_lockdep; |
121 | attr->ignore_lockdep; | ||
122 | } | 119 | } |
123 | 120 | ||
124 | #else | 121 | #else |
@@ -219,10 +216,10 @@ int sysfs_inode_init(void); | |||
219 | extern const struct file_operations kernfs_file_operations; | 216 | extern const struct file_operations kernfs_file_operations; |
220 | 217 | ||
221 | int sysfs_add_file(struct sysfs_dirent *dir_sd, | 218 | int sysfs_add_file(struct sysfs_dirent *dir_sd, |
222 | const struct attribute *attr, int type); | 219 | const struct attribute *attr, bool is_bin); |
223 | 220 | ||
224 | int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd, | 221 | int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd, |
225 | const struct attribute *attr, int type, | 222 | const struct attribute *attr, bool is_bin, |
226 | umode_t amode, const void *ns); | 223 | umode_t amode, const void *ns); |
227 | void sysfs_unmap_bin_file(struct sysfs_dirent *sd); | 224 | void sysfs_unmap_bin_file(struct sysfs_dirent *sd); |
228 | 225 | ||