/* Return the status of a device as a text string for each target.  */
static int table_status(struct dm_ioctl *param, size_t param_size)
/* Return the status of a device as a text string for each target.  */
static int table_status(struct dm_ioctl *param, size_t param_size)
{
	int r;
	struct mapped_device *md;
	struct dm_table *table;
	md = find_device(param);
	if (!md)
		return -ENXIO;
	r = __dev_status(md, param);
	if (r)
		goto out;
	table = dm_get_live_or_inactive_table(md, param);
	if (table) {
		retrieve_status(table, param, param_size);
		dm_table_put(table);
	}
out:
	dm_put(md);
	return r;
}