return -1; 
return -EIO; 
static int snapshot_map(struct dm_target *ti, struct bio *bio,			union map_info *map_context){	struct exception *e;	struct dm_snapshot *s = (struct dm_snapshot *) ti->private;	int r = 1;	chunk_t chunk;	struct pending_exception *pe;	chunk = sector_to_chunk(s, bio->bi_sector);	/* Full snapshots are not usable */	if (!s->valid)		return -1;	/*	 * Write to snapshot - higher level takes care of RW/RO	 * flags so we should only get this if we are	 * writeable.	 */	if (bio_rw(bio) == WRITE) {		/* FIXME: should only take write lock if we need		 * to copy an exception */		down_write(&s->lock);		/* If the block is already remapped - use that, else remap it */		e = lookup_exception(&s->complete, chunk);		if (e) {			remap_exception(s, e, bio);			up_write(&s->lock);		} else {			pe = __find_pending_exception(s, bio);			if (!pe) {				if (s->store.drop_snapshot)					s->store.drop_snapshot(&s->store);				s->valid = 0;				r = -EIO;				up_write(&s->lock);			} else {				remap_exception(s, &pe->e, bio);				bio_list_add(&pe->snapshot_bios, bio);				if (!pe->started) {					/* this is protected by snap->lock */					pe->started = 1;					up_write(&s->lock);					start_copy(pe);				} else					up_write(&s->lock);				r = 0;			}		}	} else {		/*		 * FIXME: this read path scares me because we		 * always use the origin when we have a pending		 * exception.  However I can't think of a		 * situation where this is wrong - ejt.		 */		/* Do reads */		down_read(&s->lock);		/* See if it it has been remapped */		e = lookup_exception(&s->complete, chunk);		if (e)			remap_exception(s, e, bio);		else			bio->bi_bdev = s->origin->bdev;		up_read(&s->lock);	}	return r;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f6a80ea8ed44de0b19c42d41928be37a186a3f41/dm-snap.c/clean/drivers/md/dm-snap.c