mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -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
|
|
@ -1157,12 +1157,12 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
|
|||
iocb->ki_filp->f_mapping;
|
||||
|
||||
/* will be released by direct_io_worker */
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_lock(inode);
|
||||
|
||||
retval = filemap_write_and_wait_range(mapping, offset,
|
||||
end - 1);
|
||||
if (retval) {
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
kmem_cache_free(dio_cache, dio);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1173,7 +1173,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
|
|||
dio->i_size = i_size_read(inode);
|
||||
if (iov_iter_rw(iter) == READ && offset >= dio->i_size) {
|
||||
if (dio->flags & DIO_LOCKING)
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
inode_unlock(inode);
|
||||
kmem_cache_free(dio_cache, dio);
|
||||
retval = 0;
|
||||
goto out;
|
||||
|
|
@ -1295,7 +1295,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
|
|||
* of protecting us from looking up uninitialized blocks.
|
||||
*/
|
||||
if (iov_iter_rw(iter) == READ && (dio->flags & DIO_LOCKING))
|
||||
mutex_unlock(&dio->inode->i_mutex);
|
||||
inode_unlock(dio->inode);
|
||||
|
||||
/*
|
||||
* The only time we want to leave bios in flight is when a successful
|
||||
|
|
|
|||
Loading…
Reference in a new issue