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 17:41:35 -0800 |
commit | a7dc66dfb4c6d6c1d7c14d5106ce467f1dbd4eba (patch) | |
tree | 013752fe5b620dd8bda9318bd1156941c5995de3 /fs/sysfs/sysfs.h | |
parent | 471bd7b78bd56c580e91e00a0f656ca922ab3b3c (diff) | |
download | op-kernel-dev-a7dc66dfb4c6d6c1d7c14d5106ce467f1dbd4eba.zip op-kernel-dev-a7dc66dfb4c6d6c1d7c14d5106ce467f1dbd4eba.tar.gz |
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 d40e85e..28898fa 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -83,10 +83,9 @@ struct sysfs_dirent { #define SYSFS_TYPE_MASK 0x00ff #define SYSFS_DIR 0x0001 #define SYSFS_KOBJ_ATTR 0x0002 -#define SYSFS_KOBJ_BIN_ATTR 0x0004 #define SYSFS_KOBJ_LINK 0x0008 #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) -#define SYSFS_ACTIVE_REF (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR) +#define SYSFS_ACTIVE_REF SYSFS_KOBJ_ATTR #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK #define SYSFS_FLAG_NS 0x01000 @@ -115,10 +114,8 @@ do { \ static inline bool sysfs_ignore_lockdep(struct sysfs_dirent *sd) { struct attribute *attr = sd->priv; - int type = sysfs_type(sd); - return (type == SYSFS_KOBJ_ATTR || type == SYSFS_KOBJ_BIN_ATTR) && - attr->ignore_lockdep; + return sysfs_type(sd) == SYSFS_KOBJ_ATTR && attr->ignore_lockdep; } #else @@ -219,10 +216,10 @@ int sysfs_inode_init(void); extern const struct file_operations kernfs_file_operations; int sysfs_add_file(struct sysfs_dirent *dir_sd, - const struct attribute *attr, int type); + const struct attribute *attr, bool is_bin); int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd, - const struct attribute *attr, int type, + const struct attribute *attr, bool is_bin, umode_t amode, const void *ns); void sysfs_unmap_bin_file(struct sysfs_dirent *sd); |