diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 15:27:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:08 -0400 |
commit | b402d72cf7b338a074e3c12b305ec79284e18845 (patch) | |
tree | 0724d40180eb78212be81c7ff2d909ec3fb3f306 /fs/sysfs/inode.c | |
parent | d0bcb5689a521df98bff7549fcb8b17499660a99 (diff) |
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>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 63daa06c4194..ee3a5d957051 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -242,7 +242,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) | |||
242 | 242 | ||
243 | dput(dentry); | 243 | dput(dentry); |
244 | /* XXX: unpin if directory, this will go away soon */ | 244 | /* XXX: unpin if directory, this will go away soon */ |
245 | if (sd->s_type & SYSFS_DIR) | 245 | if (sysfs_type(sd) == SYSFS_DIR) |
246 | dput(dentry); | 246 | dput(dentry); |
247 | 247 | ||
248 | /* adjust nlink and update timestamp */ | 248 | /* adjust nlink and update timestamp */ |
@@ -254,7 +254,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) | |||
254 | 254 | ||
255 | inode->i_ctime = curtime; | 255 | inode->i_ctime = curtime; |
256 | drop_nlink(inode); | 256 | drop_nlink(inode); |
257 | if (sd->s_type & SYSFS_DIR) | 257 | if (sysfs_type(sd) == SYSFS_DIR) |
258 | drop_nlink(inode); | 258 | drop_nlink(inode); |
259 | 259 | ||
260 | mutex_unlock(&inode->i_mutex); | 260 | mutex_unlock(&inode->i_mutex); |
@@ -267,7 +267,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) | |||
267 | mutex_lock(&inode->i_mutex); | 267 | mutex_lock(&inode->i_mutex); |
268 | 268 | ||
269 | inode->i_ctime = inode->i_mtime = curtime; | 269 | inode->i_ctime = inode->i_mtime = curtime; |
270 | if (sd->s_type & SYSFS_DIR) | 270 | if (sysfs_type(sd) == SYSFS_DIR) |
271 | drop_nlink(inode); | 271 | drop_nlink(inode); |
272 | 272 | ||
273 | mutex_unlock(&inode->i_mutex); | 273 | mutex_unlock(&inode->i_mutex); |
@@ -293,7 +293,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name) | |||
293 | for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) { | 293 | for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) { |
294 | sd = *pos; | 294 | sd = *pos; |
295 | 295 | ||
296 | if (!sd->s_type) | 296 | if (!sysfs_type(sd)) |
297 | continue; | 297 | continue; |
298 | if (!strcmp(sd->s_name, name)) { | 298 | if (!strcmp(sd->s_name, name)) { |
299 | *pos = sd->s_sibling; | 299 | *pos = sd->s_sibling; |