Skip to content

Commit 5a0143a

Browse files
committed
ext3: Remove i_mutex from ext3_sync_file()
ext3_sync_file() does not need i_mutex for anything so just drop it. Signed-off-by: Jan Kara <jack@suse.cz>
1 parent ab7e2db commit 5a0143a

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

‎fs/ext3/fsync.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
6161
if (ret)
6262
goto out;
6363

64-
/*
65-
* Taking the mutex here just to keep consistent with how fsync was
66-
* called previously, however it looks like we don't need to take
67-
* i_mutex at all.
68-
*/
69-
mutex_lock(&inode->i_mutex);
70-
7164
J_ASSERT(ext3_journal_current_handle() == NULL);
7265

7366
/*
@@ -85,7 +78,6 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
8578
* safe in-journal, which is all fsync() needs to ensure.
8679
*/
8780
if (ext3_should_journal_data(inode)) {
88-
mutex_unlock(&inode->i_mutex);
8981
ret = ext3_force_commit(inode->i_sb);
9082
goto out;
9183
}
@@ -108,8 +100,6 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
108100
*/
109101
if (needs_barrier)
110102
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
111-
112-
mutex_unlock(&inode->i_mutex);
113103
out:
114104
trace_ext3_sync_file_exit(inode, ret);
115105
return ret;

0 commit comments

Comments
 (0)