/* Origin: maps a linear range of a device, with hooks for snapshotting. Construct an origin mapping: <dev_path> The context for an origin is merely a 'struct dm_dev *' pointing to the real device.  */
static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
/* Origin: maps a linear range of a device, with hooks for snapshotting. Construct an origin mapping: <dev_path> The context for an origin is merely a 'struct dm_dev *' pointing to the real device.  */
static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
{
	int r;
	struct dm_dev *dev;
	if (argc != 1) {
		ti->error = "origin: incorrect number of arguments";
		return -EINVAL;
	}
	r = dm_get_device(ti, argv[0], 0, ti->len,
			  dm_table_get_mode(ti->table), &dev);
	if (r) {
		ti->error = "Cannot get target device";
		return r;
	}
	ti->private = dev;
	ti->num_flush_requests = 1;
	return 0;
}