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>
This commit is contained in:
Tejun Heo
2007-06-14 04:27:23 +09:00
committed by Greg Kroah-Hartman
parent 608e266a2d
commit 5f9953237f
4 changed files with 21 additions and 23 deletions

View File

@@ -82,12 +82,12 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, const char
return -EFAULT;
/* target->sd can go away beneath us but is protected with
* kobj_sysfs_assoc_lock. Fetch target_sd from it.
* sysfs_assoc_lock. Fetch target_sd from it.
*/
spin_lock(&kobj_sysfs_assoc_lock);
spin_lock(&sysfs_assoc_lock);
if (target->sd)
target_sd = sysfs_get(target->sd);
spin_unlock(&kobj_sysfs_assoc_lock);
spin_unlock(&sysfs_assoc_lock);
if (!target_sd)
return -ENOENT;