summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-14 04:27:23 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 16:09:08 -0700
commit5f9953237f684ea1778adb9d26162da00b282225 (patch)
tree962bbe5fe2483876caa74943875cbef432db6945 /fs/sysfs/inode.c
parent608e266a2d4e62c1b98c1c573064b6afe8c06a58 (diff)
downloadlinux-5f9953237f684ea1778adb9d26162da00b282225.tar.bz2
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.c16
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)
* parent on entry to this function such that it can't be looked
* up anymore.
*
- * @sd->s_dentry which is protected with sysfs_lock points to the
- * currently associated dentry but we're not holding a reference
- * to it and racing with dput(). Grab dcache_lock and verify
- * dentry before dropping it. If @sd->s_dentry is NULL or dput()
- * beats us, no need to bother.
+ * @sd->s_dentry which is protected with sysfs_assoc_lock points
+ * to the currently associated dentry but we're not holding a
+ * reference to it and racing with dput(). Grab dcache_lock and
+ * verify dentry before dropping it. If @sd->s_dentry is NULL or
+ * dput() beats us, no need to bother.
*/
void sysfs_drop_dentry(struct sysfs_dirent *sd)
{
@@ -224,9 +224,9 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
struct inode *inode;
/* We're not holding a reference to ->s_dentry dentry but the
- * field will stay valid as long as sysfs_lock is held.
+ * field will stay valid as long as sysfs_assoc_lock is held.
*/
- spin_lock(&sysfs_lock);
+ spin_lock(&sysfs_assoc_lock);
spin_lock(&dcache_lock);
/* 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)
}
spin_unlock(&dcache_lock);
- spin_unlock(&sysfs_lock);
+ spin_unlock(&sysfs_assoc_lock);
dput(dentry);
/* XXX: unpin if directory, this will go away soon */