diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 15:27:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:08 -0400 |
commit | 5f9953237f684ea1778adb9d26162da00b282225 (patch) | |
tree | 962bbe5fe2483876caa74943875cbef432db6945 /fs/sysfs/inode.c | |
parent | 608e266a2d4e62c1b98c1c573064b6afe8c06a58 (diff) |
sysfs: consolidate sysfs spinlocks
Replace sysfs_lock and kobj_sysfs_assoc_lock with sysfs_assoc_lock.
sysfs_lock was originally to be used to protect sysfs_dirent tree but
mutex seems better choice, so there is no reason to keep sysfs_lock
separate. Merge the two spinlocks into one.
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 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 1be853706e99..e4c23939fb36 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -211,11 +211,11 @@ void sysfs_instantiate(struct dentry *dentry, struct inode *inode) | |||
211 | * parent on entry to this function such that it can't be looked | 211 | * parent on entry to this function such that it can't be looked |
212 | * up anymore. | 212 | * up anymore. |
213 | * | 213 | * |
214 | * @sd->s_dentry which is protected with sysfs_lock points to the | 214 | * @sd->s_dentry which is protected with sysfs_assoc_lock points |
215 | * currently associated dentry but we're not holding a reference | 215 | * to the currently associated dentry but we're not holding a |
216 | * to it and racing with dput(). Grab dcache_lock and verify | 216 | * reference to it and racing with dput(). Grab dcache_lock and |
217 | * dentry before dropping it. If @sd->s_dentry is NULL or dput() | 217 | * verify dentry before dropping it. If @sd->s_dentry is NULL or |
218 | * beats us, no need to bother. | 218 | * dput() beats us, no need to bother. |
219 | */ | 219 | */ |
220 | void sysfs_drop_dentry(struct sysfs_dirent *sd) | 220 | void sysfs_drop_dentry(struct sysfs_dirent *sd) |
221 | { | 221 | { |
@@ -224,9 +224,9 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) | |||
224 | struct inode *inode; | 224 | struct inode *inode; |
225 | 225 | ||
226 | /* We're not holding a reference to ->s_dentry dentry but the | 226 | /* We're not holding a reference to ->s_dentry dentry but the |
227 | * field will stay valid as long as sysfs_lock is held. | 227 | * field will stay valid as long as sysfs_assoc_lock is held. |
228 | */ | 228 | */ |
229 | spin_lock(&sysfs_lock); | 229 | spin_lock(&sysfs_assoc_lock); |
230 | spin_lock(&dcache_lock); | 230 | spin_lock(&dcache_lock); |
231 | 231 | ||
232 | /* drop dentry if it's there and dput() didn't kill it yet */ | 232 | /* drop dentry if it's there and dput() didn't kill it yet */ |
@@ -238,7 +238,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | spin_unlock(&dcache_lock); | 240 | spin_unlock(&dcache_lock); |
241 | spin_unlock(&sysfs_lock); | 241 | spin_unlock(&sysfs_assoc_lock); |
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 */ |