mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
configfs: Convert subsystem semaphore to mutex
Convert the su_sem member of struct configfs_subsystem to a struct
mutex, as that's what it is. Also convert all the users and update
Documentation/configfs.txt and Documentation/configfs_example.c
accordingly.
[ Conflict in fs/dlm/config.c with commit
3168b0780d manually resolved. --Mark ]
Inspired-by: Satyam Sharma <[email protected]>
Signed-off-by: Joel Becker <[email protected]>
Signed-off-by: Mark Fasheh <[email protected]>
This commit is contained in:
parent
3fe6c5ce11
commit
e6bd07aee7
6 changed files with 26 additions and 26 deletions
|
|
@ -562,7 +562,7 @@ static int populate_groups(struct config_group *group)
|
|||
|
||||
/*
|
||||
* All of link_obj/unlink_obj/link_group/unlink_group require that
|
||||
* subsys->su_sem is held.
|
||||
* subsys->su_mutex is held.
|
||||
*/
|
||||
|
||||
static void unlink_obj(struct config_item *item)
|
||||
|
|
@ -783,7 +783,7 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
|
|||
|
||||
snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name);
|
||||
|
||||
down(&subsys->su_sem);
|
||||
mutex_lock(&subsys->su_mutex);
|
||||
group = NULL;
|
||||
item = NULL;
|
||||
if (type->ct_group_ops->make_group) {
|
||||
|
|
@ -797,7 +797,7 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
|
|||
if (item)
|
||||
link_obj(parent_item, item);
|
||||
}
|
||||
up(&subsys->su_sem);
|
||||
mutex_unlock(&subsys->su_mutex);
|
||||
|
||||
kfree(name);
|
||||
if (!item) {
|
||||
|
|
@ -841,13 +841,13 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
|
|||
out_unlink:
|
||||
if (ret) {
|
||||
/* Tear down everything we built up */
|
||||
down(&subsys->su_sem);
|
||||
mutex_lock(&subsys->su_mutex);
|
||||
if (group)
|
||||
unlink_group(group);
|
||||
else
|
||||
unlink_obj(item);
|
||||
client_drop_item(parent_item, item);
|
||||
up(&subsys->su_sem);
|
||||
mutex_unlock(&subsys->su_mutex);
|
||||
|
||||
if (module_got)
|
||||
module_put(owner);
|
||||
|
|
@ -910,17 +910,17 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
|
|||
if (sd->s_type & CONFIGFS_USET_DIR) {
|
||||
configfs_detach_group(item);
|
||||
|
||||
down(&subsys->su_sem);
|
||||
mutex_lock(&subsys->su_mutex);
|
||||
unlink_group(to_config_group(item));
|
||||
} else {
|
||||
configfs_detach_item(item);
|
||||
|
||||
down(&subsys->su_sem);
|
||||
mutex_lock(&subsys->su_mutex);
|
||||
unlink_obj(item);
|
||||
}
|
||||
|
||||
client_drop_item(parent_item, item);
|
||||
up(&subsys->su_sem);
|
||||
mutex_unlock(&subsys->su_mutex);
|
||||
|
||||
/* Drop our reference from above */
|
||||
config_item_put(item);
|
||||
|
|
|
|||
Loading…
Reference in a new issue