mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex). Please, use those for access to ->i_mutex; over the coming cycle ->i_mutex will become rwsem, with ->lookup() done with it held only shared. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
57b8f112cf
commit
5955102c99
177 changed files with 908 additions and 883 deletions
|
@ -99,7 +99,7 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode,
|
|||
|
||||
dir = d_inode(parent);
|
||||
|
||||
mutex_lock(&dir->i_mutex);
|
||||
inode_lock(dir);
|
||||
dentry = lookup_one_len(name, parent, strlen(name));
|
||||
if (IS_ERR(dentry))
|
||||
goto out;
|
||||
|
@ -129,14 +129,14 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode,
|
|||
}
|
||||
d_instantiate(dentry, inode);
|
||||
dget(dentry);
|
||||
mutex_unlock(&dir->i_mutex);
|
||||
inode_unlock(dir);
|
||||
return dentry;
|
||||
|
||||
out1:
|
||||
dput(dentry);
|
||||
dentry = ERR_PTR(error);
|
||||
out:
|
||||
mutex_unlock(&dir->i_mutex);
|
||||
inode_unlock(dir);
|
||||
simple_release_fs(&mount, &mount_count);
|
||||
return dentry;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void securityfs_remove(struct dentry *dentry)
|
|||
if (!parent || d_really_is_negative(parent))
|
||||
return;
|
||||
|
||||
mutex_lock(&d_inode(parent)->i_mutex);
|
||||
inode_lock(d_inode(parent));
|
||||
if (simple_positive(dentry)) {
|
||||
if (d_is_dir(dentry))
|
||||
simple_rmdir(d_inode(parent), dentry);
|
||||
|
@ -203,7 +203,7 @@ void securityfs_remove(struct dentry *dentry)
|
|||
simple_unlink(d_inode(parent), dentry);
|
||||
dput(dentry);
|
||||
}
|
||||
mutex_unlock(&d_inode(parent)->i_mutex);
|
||||
inode_unlock(d_inode(parent));
|
||||
simple_release_fs(&mount, &mount_count);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(securityfs_remove);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue