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:
+6
-6
@@ -124,10 +124,10 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
|
||||
int err;
|
||||
|
||||
parent = ERR_PTR(-EACCES);
|
||||
mutex_lock(&dentry->d_inode->i_mutex);
|
||||
inode_lock(dentry->d_inode);
|
||||
if (mnt->mnt_sb->s_export_op->get_parent)
|
||||
parent = mnt->mnt_sb->s_export_op->get_parent(dentry);
|
||||
mutex_unlock(&dentry->d_inode->i_mutex);
|
||||
inode_unlock(dentry->d_inode);
|
||||
|
||||
if (IS_ERR(parent)) {
|
||||
dprintk("%s: get_parent of %ld failed, err %d\n",
|
||||
@@ -143,9 +143,9 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
|
||||
if (err)
|
||||
goto out_err;
|
||||
dprintk("%s: found name: %s\n", __func__, nbuf);
|
||||
mutex_lock(&parent->d_inode->i_mutex);
|
||||
inode_lock(parent->d_inode);
|
||||
tmp = lookup_one_len(nbuf, parent, strlen(nbuf));
|
||||
mutex_unlock(&parent->d_inode->i_mutex);
|
||||
inode_unlock(parent->d_inode);
|
||||
if (IS_ERR(tmp)) {
|
||||
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
|
||||
goto out_err;
|
||||
@@ -503,10 +503,10 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
|
||||
*/
|
||||
err = exportfs_get_name(mnt, target_dir, nbuf, result);
|
||||
if (!err) {
|
||||
mutex_lock(&target_dir->d_inode->i_mutex);
|
||||
inode_lock(target_dir->d_inode);
|
||||
nresult = lookup_one_len(nbuf, target_dir,
|
||||
strlen(nbuf));
|
||||
mutex_unlock(&target_dir->d_inode->i_mutex);
|
||||
inode_unlock(target_dir->d_inode);
|
||||
if (!IS_ERR(nresult)) {
|
||||
if (nresult->d_inode) {
|
||||
dput(result);
|
||||
|
||||
Reference in New Issue
Block a user