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:
Al Viro
2016-01-22 15:40:57 -05:00
parent 57b8f112cf
commit 5955102c99
177 changed files with 908 additions and 883 deletions

View File

@@ -229,7 +229,7 @@ void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry)
{
struct ovl_entry *oe = dentry->d_fsdata;
WARN_ON(!mutex_is_locked(&upperdentry->d_parent->d_inode->i_mutex));
WARN_ON(!inode_is_locked(upperdentry->d_parent->d_inode));
WARN_ON(oe->__upperdentry);
BUG_ON(!upperdentry->d_inode);
/*
@@ -244,7 +244,7 @@ void ovl_dentry_version_inc(struct dentry *dentry)
{
struct ovl_entry *oe = dentry->d_fsdata;
WARN_ON(!mutex_is_locked(&dentry->d_inode->i_mutex));
WARN_ON(!inode_is_locked(dentry->d_inode));
oe->version++;
}
@@ -252,7 +252,7 @@ u64 ovl_dentry_version_get(struct dentry *dentry)
{
struct ovl_entry *oe = dentry->d_fsdata;
WARN_ON(!mutex_is_locked(&dentry->d_inode->i_mutex));
WARN_ON(!inode_is_locked(dentry->d_inode));
return oe->version;
}
@@ -375,9 +375,9 @@ static inline struct dentry *ovl_lookup_real(struct dentry *dir,
{
struct dentry *dentry;
mutex_lock(&dir->d_inode->i_mutex);
inode_lock(dir->d_inode);
dentry = lookup_one_len(name->name, dir, name->len);
mutex_unlock(&dir->d_inode->i_mutex);
inode_unlock(dir->d_inode);
if (IS_ERR(dentry)) {
if (PTR_ERR(dentry) == -ENOENT)
@@ -744,7 +744,7 @@ static struct dentry *ovl_workdir_create(struct vfsmount *mnt,
if (err)
return ERR_PTR(err);
mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
inode_lock_nested(dir, I_MUTEX_PARENT);
retry:
work = lookup_one_len(OVL_WORKDIR_NAME, dentry,
strlen(OVL_WORKDIR_NAME));
@@ -770,7 +770,7 @@ retry:
goto out_dput;
}
out_unlock:
mutex_unlock(&dir->i_mutex);
inode_unlock(dir);
mnt_drop_write(mnt);
return work;