mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04: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 <[email protected]>
This commit is contained in:
parent
57b8f112cf
commit
5955102c99
177 changed files with 908 additions and 883 deletions
|
|
@ -38,17 +38,17 @@ int jfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
if (!(inode->i_state & I_DIRTY_ALL) ||
|
||||
(datasync && !(inode->i_state & I_DIRTY_DATASYNC))) {
|
||||
/* Make sure committed changes hit the disk */
|
||||
jfs_flush_journal(JFS_SBI(inode->i_sb)->log, 1);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc |= jfs_commit_inode(inode, 1);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
|
||||
return rc ? -EIO : 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
}
|
||||
|
||||
/* Lock against other parallel changes of flags */
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
|
||||
jfs_get_inode_flags(jfs_inode);
|
||||
oldflags = jfs_inode->mode2;
|
||||
|
|
@ -109,7 +109,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
((flags ^ oldflags) &
|
||||
(JFS_APPEND_FL | JFS_IMMUTABLE_FL))) {
|
||||
if (!capable(CAP_LINUX_IMMUTABLE)) {
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
err = -EPERM;
|
||||
goto setflags_out;
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
jfs_inode->mode2 = flags;
|
||||
|
||||
jfs_set_inode_flags(inode);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
mark_inode_dirty(inode);
|
||||
setflags_out:
|
||||
|
|
|
|||
|
|
@ -792,7 +792,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
|
|||
struct buffer_head tmp_bh;
|
||||
struct buffer_head *bh;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
while (towrite > 0) {
|
||||
tocopy = sb->s_blocksize - offset < towrite ?
|
||||
sb->s_blocksize - offset : towrite;
|
||||
|
|
@ -824,7 +824,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
|
|||
}
|
||||
out:
|
||||
if (len == towrite) {
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
return err;
|
||||
}
|
||||
if (inode->i_size < off+len-towrite)
|
||||
|
|
@ -832,7 +832,7 @@ out:
|
|||
inode->i_version++;
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
mark_inode_dirty(inode);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
return len - towrite;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue