/* work queue call back to submit previously compressed pages  */
static noinline void async_cow_submit(struct btrfs_work *work)
/* work queue call back to submit previously compressed pages  */
static noinline void async_cow_submit(struct btrfs_work *work)
{
	struct async_cow *async_cow;
	struct btrfs_root *root;
	unsigned long nr_pages;
	async_cow = container_of(work, struct async_cow, work);
	root = async_cow->root;
	nr_pages = (async_cow->end - async_cow->start + PAGE_CACHE_SIZE) >>
		PAGE_CACHE_SHIFT;
	atomic_sub(nr_pages, &root->fs_info->async_delalloc_pages);
	if (atomic_read(&root->fs_info->async_delalloc_pages) <
	    5 * 1042 * 1024 &&
	    waitqueue_active(&root->fs_info->async_submit_wait))
		wake_up(&root->fs_info->async_submit_wait);
	if (async_cow->inode)
		submit_compressed_extents(async_cow->inode, async_cow);
}