mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +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
|
@ -638,11 +638,11 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
|
|||
case 3:
|
||||
/* Delete this handler. */
|
||||
root = dget(file->f_path.dentry->d_sb->s_root);
|
||||
mutex_lock(&d_inode(root)->i_mutex);
|
||||
inode_lock(d_inode(root));
|
||||
|
||||
kill_node(e);
|
||||
|
||||
mutex_unlock(&d_inode(root)->i_mutex);
|
||||
inode_unlock(d_inode(root));
|
||||
dput(root);
|
||||
break;
|
||||
default:
|
||||
|
@ -675,7 +675,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
|
|||
return PTR_ERR(e);
|
||||
|
||||
root = dget(sb->s_root);
|
||||
mutex_lock(&d_inode(root)->i_mutex);
|
||||
inode_lock(d_inode(root));
|
||||
dentry = lookup_one_len(e->name, root, strlen(e->name));
|
||||
err = PTR_ERR(dentry);
|
||||
if (IS_ERR(dentry))
|
||||
|
@ -711,7 +711,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
|
|||
out2:
|
||||
dput(dentry);
|
||||
out:
|
||||
mutex_unlock(&d_inode(root)->i_mutex);
|
||||
inode_unlock(d_inode(root));
|
||||
dput(root);
|
||||
|
||||
if (err) {
|
||||
|
@ -754,12 +754,12 @@ static ssize_t bm_status_write(struct file *file, const char __user *buffer,
|
|||
case 3:
|
||||
/* Delete all handlers. */
|
||||
root = dget(file->f_path.dentry->d_sb->s_root);
|
||||
mutex_lock(&d_inode(root)->i_mutex);
|
||||
inode_lock(d_inode(root));
|
||||
|
||||
while (!list_empty(&entries))
|
||||
kill_node(list_entry(entries.next, Node, list));
|
||||
|
||||
mutex_unlock(&d_inode(root)->i_mutex);
|
||||
inode_unlock(d_inode(root));
|
||||
dput(root);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue