Btrfs: fix tree logs parallel sync
[linux-2.6-block.git] / fs / btrfs / file.c
index fbcbf43f5114a200f56705b88aaa6308a9b4d48b..3e8023efaff7581568f8d9a4f131a01c37f76d3b 100644 (file)
@@ -1214,10 +1214,10 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
        }
        mutex_unlock(&root->fs_info->trans_mutex);
 
-       root->fs_info->tree_log_batch++;
+       root->log_batch++;
        filemap_fdatawrite(inode->i_mapping);
        btrfs_wait_ordered_range(inode, 0, (u64)-1);
-       root->fs_info->tree_log_batch++;
+       root->log_batch++;
 
        /*
         * ok we haven't committed the transaction yet, lets do a commit