sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags
Rename sysfs_dirent->s_type to s_flags, pack type into lower eight bits and reserve the rest for flags. sysfs_type() can used to access the type. All existing sd->s_type accesses are converted to use sysfs_type(). While at it, type test is changed to equality test instead of bit-and test where appropriate. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d0bcb5689a
commit
b402d72cf7
@ -74,6 +74,7 @@ struct sysfs_ops {
|
||||
ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
|
||||
};
|
||||
|
||||
#define SYSFS_TYPE_MASK 0x00ff
|
||||
#define SYSFS_ROOT 0x0001
|
||||
#define SYSFS_DIR 0x0002
|
||||
#define SYSFS_KOBJ_ATTR 0x0004
|
||||
@ -82,6 +83,8 @@ struct sysfs_ops {
|
||||
#define SYSFS_NOT_PINNED (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_LINK)
|
||||
#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
|
||||
|
||||
#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
|
||||
|
||||
#ifdef CONFIG_SYSFS
|
||||
|
||||
extern int sysfs_schedule_callback(struct kobject *kobj,
|
||||
|
Reference in New Issue
Block a user