mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -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
|
|
@ -1509,7 +1509,7 @@ static int ntfs_dir_fsync(struct file *filp, loff_t start, loff_t end,
|
|||
err = filemap_write_and_wait_range(vi->i_mapping, start, end);
|
||||
if (err)
|
||||
return err;
|
||||
mutex_lock(&vi->i_mutex);
|
||||
inode_lock(vi);
|
||||
|
||||
BUG_ON(!S_ISDIR(vi->i_mode));
|
||||
/* If the bitmap attribute inode is in memory sync it, too. */
|
||||
|
|
@ -1532,7 +1532,7 @@ static int ntfs_dir_fsync(struct file *filp, loff_t start, loff_t end,
|
|||
else
|
||||
ntfs_warning(vi->i_sb, "Failed to f%ssync inode 0x%lx. Error "
|
||||
"%u.", datasync ? "data" : "", vi->i_ino, -ret);
|
||||
mutex_unlock(&vi->i_mutex);
|
||||
inode_unlock(vi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1944,14 +1944,14 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
|||
ssize_t written = 0;
|
||||
ssize_t err;
|
||||
|
||||
mutex_lock(&vi->i_mutex);
|
||||
inode_lock(vi);
|
||||
/* We can write back this queue in page reclaim. */
|
||||
current->backing_dev_info = inode_to_bdi(vi);
|
||||
err = ntfs_prepare_file_for_write(iocb, from);
|
||||
if (iov_iter_count(from) && !err)
|
||||
written = ntfs_perform_write(file, from, iocb->ki_pos);
|
||||
current->backing_dev_info = NULL;
|
||||
mutex_unlock(&vi->i_mutex);
|
||||
inode_unlock(vi);
|
||||
if (likely(written > 0)) {
|
||||
err = generic_write_sync(file, iocb->ki_pos, written);
|
||||
if (err < 0)
|
||||
|
|
@ -1996,7 +1996,7 @@ static int ntfs_file_fsync(struct file *filp, loff_t start, loff_t end,
|
|||
err = filemap_write_and_wait_range(vi->i_mapping, start, end);
|
||||
if (err)
|
||||
return err;
|
||||
mutex_lock(&vi->i_mutex);
|
||||
inode_lock(vi);
|
||||
|
||||
BUG_ON(S_ISDIR(vi->i_mode));
|
||||
if (!datasync || !NInoNonResident(NTFS_I(vi)))
|
||||
|
|
@ -2015,7 +2015,7 @@ static int ntfs_file_fsync(struct file *filp, loff_t start, loff_t end,
|
|||
else
|
||||
ntfs_warning(vi->i_sb, "Failed to f%ssync inode 0x%lx. Error "
|
||||
"%u.", datasync ? "data" : "", vi->i_ino, -ret);
|
||||
mutex_unlock(&vi->i_mutex);
|
||||
inode_unlock(vi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ bool ntfs_mark_quotas_out_of_date(ntfs_volume *vol)
|
|||
ntfs_error(vol->sb, "Quota inodes are not open.");
|
||||
return false;
|
||||
}
|
||||
mutex_lock(&vol->quota_q_ino->i_mutex);
|
||||
inode_lock(vol->quota_q_ino);
|
||||
ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino));
|
||||
if (!ictx) {
|
||||
ntfs_error(vol->sb, "Failed to get index context.");
|
||||
|
|
@ -98,7 +98,7 @@ bool ntfs_mark_quotas_out_of_date(ntfs_volume *vol)
|
|||
ntfs_index_entry_mark_dirty(ictx);
|
||||
set_done:
|
||||
ntfs_index_ctx_put(ictx);
|
||||
mutex_unlock(&vol->quota_q_ino->i_mutex);
|
||||
inode_unlock(vol->quota_q_ino);
|
||||
/*
|
||||
* We set the flag so we do not try to mark the quotas out of date
|
||||
* again on remount.
|
||||
|
|
@ -110,7 +110,7 @@ done:
|
|||
err_out:
|
||||
if (ictx)
|
||||
ntfs_index_ctx_put(ictx);
|
||||
mutex_unlock(&vol->quota_q_ino->i_mutex);
|
||||
inode_unlock(vol->quota_q_ino);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1284,10 +1284,10 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
|
|||
* Find the inode number for the hibernation file by looking up the
|
||||
* filename hiberfil.sys in the root directory.
|
||||
*/
|
||||
mutex_lock(&vol->root_ino->i_mutex);
|
||||
inode_lock(vol->root_ino);
|
||||
mref = ntfs_lookup_inode_by_name(NTFS_I(vol->root_ino), hiberfil, 12,
|
||||
&name);
|
||||
mutex_unlock(&vol->root_ino->i_mutex);
|
||||
inode_unlock(vol->root_ino);
|
||||
if (IS_ERR_MREF(mref)) {
|
||||
ret = MREF_ERR(mref);
|
||||
/* If the file does not exist, Windows is not hibernated. */
|
||||
|
|
@ -1377,10 +1377,10 @@ static bool load_and_init_quota(ntfs_volume *vol)
|
|||
* Find the inode number for the quota file by looking up the filename
|
||||
* $Quota in the extended system files directory $Extend.
|
||||
*/
|
||||
mutex_lock(&vol->extend_ino->i_mutex);
|
||||
inode_lock(vol->extend_ino);
|
||||
mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), Quota, 6,
|
||||
&name);
|
||||
mutex_unlock(&vol->extend_ino->i_mutex);
|
||||
inode_unlock(vol->extend_ino);
|
||||
if (IS_ERR_MREF(mref)) {
|
||||
/*
|
||||
* If the file does not exist, quotas are disabled and have
|
||||
|
|
@ -1460,10 +1460,10 @@ static bool load_and_init_usnjrnl(ntfs_volume *vol)
|
|||
* Find the inode number for the transaction log file by looking up the
|
||||
* filename $UsnJrnl in the extended system files directory $Extend.
|
||||
*/
|
||||
mutex_lock(&vol->extend_ino->i_mutex);
|
||||
inode_lock(vol->extend_ino);
|
||||
mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), UsnJrnl, 8,
|
||||
&name);
|
||||
mutex_unlock(&vol->extend_ino->i_mutex);
|
||||
inode_unlock(vol->extend_ino);
|
||||
if (IS_ERR_MREF(mref)) {
|
||||
/*
|
||||
* If the file does not exist, transaction logging is disabled,
|
||||
|
|
|
|||
Loading…
Reference in a new issue