/* process_func used to pin down extents, write them or wait on them  */
static int process_one_buffer(struct btrfs_root *log, struct extent_buffer *eb, struct walk_control *wc, u64 gen)
/* process_func used to pin down extents, write them or wait on them  */
static int process_one_buffer(struct btrfs_root *log, struct extent_buffer *eb, struct walk_control *wc, u64 gen)
{
	if (wc->pin)
		btrfs_pin_extent(log->fs_info->extent_root,
				 eb->start, eb->len, 0);
	if (btrfs_buffer_uptodate(eb, gen)) {
		if (wc->write)
			btrfs_write_tree_block(eb);
		if (wc->wait)
			btrfs_wait_tree_block_writeback(eb);
	}
	return 0;
}