btrfs: move tree block wait and write helpers to tree-log
[sfrench/cifs-2.6.git] / fs / btrfs / tree-log.c
index 561884f60d35c36e11928e28e5007901fc695198..a59e98c9fbb92a4911fe7d608eea857546dee9f5 100644 (file)
@@ -225,6 +225,17 @@ void btrfs_end_log_trans(struct btrfs_root *root)
        }
 }
 
+static int btrfs_write_tree_block(struct extent_buffer *buf)
+{
+       return filemap_fdatawrite_range(buf->pages[0]->mapping, buf->start,
+                                       buf->start + buf->len - 1);
+}
+
+static void btrfs_wait_tree_block_writeback(struct extent_buffer *buf)
+{
+       filemap_fdatawait_range(buf->pages[0]->mapping,
+                               buf->start, buf->start + buf->len - 1);
+}
 
 /*
  * the walk control struct is used to pass state down the chain when