/* extent_io.c merge_bio_hook, this must check the chunk tree to make sure we don't create bios that span stripes or chunks  */
int btrfs_merge_bio_hook(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags)
/* extent_io.c merge_bio_hook, this must check the chunk tree to make sure we don't create bios that span stripes or chunks  */
int btrfs_merge_bio_hook(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags)
{
	struct btrfs_root *root = BTRFS_I(page->mapping->host)->root;
	struct btrfs_mapping_tree *map_tree;
	u64 logical = (u64)bio->bi_sector << 9;
	u64 length = 0;
	u64 map_length;
	int ret;
	if (bio_flags & EXTENT_BIO_COMPRESSED)
		return 0;
	length = bio->bi_size;
	map_tree = &root->fs_info->mapping_tree;
	map_length = length;
	ret = btrfs_map_block(map_tree, READ, logical,
			      &map_length, NULL, 0);
	if (map_length < length + size)
		return 1;
	return 0;
}