From b402d72cf7b338a074e3c12b305ec79284e18845 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 14 Jun 2007 04:27:21 +0900 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/inode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/sysfs/inode.c') diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 63daa06c419..ee3a5d95705 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -242,7 +242,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) dput(dentry); /* XXX: unpin if directory, this will go away soon */ - if (sd->s_type & SYSFS_DIR) + if (sysfs_type(sd) == SYSFS_DIR) dput(dentry); /* adjust nlink and update timestamp */ @@ -254,7 +254,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) inode->i_ctime = curtime; drop_nlink(inode); - if (sd->s_type & SYSFS_DIR) + if (sysfs_type(sd) == SYSFS_DIR) drop_nlink(inode); mutex_unlock(&inode->i_mutex); @@ -267,7 +267,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) mutex_lock(&inode->i_mutex); inode->i_ctime = inode->i_mtime = curtime; - if (sd->s_type & SYSFS_DIR) + if (sysfs_type(sd) == SYSFS_DIR) drop_nlink(inode); mutex_unlock(&inode->i_mutex); @@ -293,7 +293,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name) for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) { sd = *pos; - if (!sd->s_type) + if (!sysfs_type(sd)) continue; if (!strcmp(sd->s_name, name)) { *pos = sd->s_sibling; -- cgit v1.2.3