summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-06-04 22:40:39 +0400
committerTheodore Ts'o <tytso@mit.edu>2013-06-04 22:40:39 +0400
commit92e6222dfb85db780ebd8caea6a3f9326c375bc0 (patch)
treed57c6ca43d9b57117f5fe029ea0ccdc61a7369ab /fs/ext4
parent37b10dd06334ebc89f551d405a0fe27e1a622458 (diff)
downloadlinux-92e6222dfb85db780ebd8caea6a3f9326c375bc0.tar.xz
ext4: remove i_mutex from ext4_file_sync()
After removal of ext4_flush_unwritten_io() call, ext4_file_sync() doesn't need i_mutex anymore. Forcing of transaction commits doesn't need i_mutex as there's nothing inode specific in that code apart from grabbing transaction ids from the inode. So remove the lock. Reviewed-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/fsync.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 6019bd449576..fc938ebbddec 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -99,20 +99,18 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
trace_ext4_sync_file_enter(file, datasync);
if (inode->i_sb->s_flags & MS_RDONLY)
- goto out_trace;
+ goto out;
if (!journal) {
ret = generic_file_fsync(file, start, end, datasync);
if (!ret && !hlist_empty(&inode->i_dentry))
ret = ext4_sync_parent(inode);
- goto out_trace;
+ goto out;
}
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (ret)
return ret;
- mutex_lock(&inode->i_mutex);
-
/*
* data=writeback,ordered:
* The caller's filemap_fdatawrite()/wait will sync the data.
@@ -143,8 +141,6 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
ret = err;
}
out:
- mutex_unlock(&inode->i_mutex);
-out_trace:
trace_ext4_sync_file_exit(inode, ret);
return ret;
}