/* size must be a multiple of merging_snap's chunk_size.  */
static int origin_write_extent(struct dm_snapshot *merging_snap, sector_t sector, unsigned chunk_size)
/* size must be a multiple of merging_snap's chunk_size.  */
static int origin_write_extent(struct dm_snapshot *merging_snap, sector_t sector, unsigned chunk_size)
{
	int must_wait = 0;
	sector_t n;
	struct origin *o;
	down_read(&_origins_lock);
	o = __lookup_origin(merging_snap->origin->bdev);
	for (n = 0; n < size; n += merging_snap->ti->split_io)
		if (__origin_write(&o->snapshots, sector + n, NULL) ==
		    DM_MAPIO_SUBMITTED)
			must_wait = 1;
	up_read(&_origins_lock);
	return must_wait;
}