aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-04-23 15:09:39 -0400
committerJosef Bacik <josef@redhat.com>2012-05-30 10:23:29 -0400
commit0885ef5b5601e9b007c383e77c172769b1f214fd (patch)
tree637186daaaa3201ca534e9981b574e538245e39e /fs/btrfs/file.c
parent551ebb2d34304ee2abfe6b00d39ec65d5e4e8266 (diff)
Btrfs: do not do filemap_write_and_wait_range in fsync
We already do the btrfs_wait_ordered_range which will do this for us, so just remove this call so we don't call it twice. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 8aa8d7fe74d7..cfc0ab915d03 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1497,14 +1497,15 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
1497 1497
1498 trace_btrfs_sync_file(file, datasync); 1498 trace_btrfs_sync_file(file, datasync);
1499 1499
1500 ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
1501 if (ret)
1502 return ret;
1503 mutex_lock(&inode->i_mutex); 1500 mutex_lock(&inode->i_mutex);
1504 1501
1505 /* we wait first, since the writeback may change the inode */ 1502 /*
1503 * we wait first, since the writeback may change the inode, also wait
1504 * ordered range does a filemape_write_and_wait_range which is why we
1505 * don't do it above like other file systems.
1506 */
1506 root->log_batch++; 1507 root->log_batch++;
1507 btrfs_wait_ordered_range(inode, 0, (u64)-1); 1508 btrfs_wait_ordered_range(inode, start, end);
1508 root->log_batch++; 1509 root->log_batch++;
1509 1510
1510 /* 1511 /*