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
@ -34,7 +34,7 @@ struct sysfs_dirent {
|
||||
struct sysfs_elem_bin_attr bin_attr;
|
||||
} s_elem;
|
||||
|
||||
int s_type;
|
||||
unsigned int s_flags;
|
||||
umode_t s_mode;
|
||||
ino_t s_ino;
|
||||
struct dentry * s_dentry;
|
||||
@ -86,6 +86,11 @@ extern const struct file_operations bin_fops;
|
||||
extern const struct inode_operations sysfs_dir_inode_operations;
|
||||
extern const struct inode_operations sysfs_symlink_inode_operations;
|
||||
|
||||
static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
|
||||
{
|
||||
return sd->s_flags & SYSFS_TYPE_MASK;
|
||||
}
|
||||
|
||||
static inline struct sysfs_dirent * sysfs_get(struct sysfs_dirent * sd)
|
||||
{
|
||||
if (sd) {
|
||||
|
Reference in New Issue
Block a user