/*
* Fail or reinstate all paths that match the provided struct dm_dev.
*/
-static int action_dev(struct multipath *m, struct dm_dev *dev,
- action_fn action)
+static int action_dev(struct multipath *m, dev_t dev, action_fn action)
{
int r = -EINVAL;
struct pgpath *pgpath;
list_for_each_entry(pg, &m->priority_groups, list) {
list_for_each_entry(pgpath, &pg->pgpaths, list) {
- if (pgpath->path.dev == dev)
+ if (pgpath->path.dev->bdev->bd_dev == dev)
r = action(pgpath);
}
}
char *result, unsigned int maxlen)
{
int r = -EINVAL;
- struct dm_dev *dev;
+ dev_t dev;
struct multipath *m = ti->private;
action_fn action;
unsigned long flags;
goto out;
}
- r = dm_get_device(ti, argv[1], dm_table_get_mode(ti->table), &dev);
+ r = dm_devt_from_path(argv[1], &dev);
if (r) {
DMWARN("message: error getting device %s",
argv[1]);
r = action_dev(m, dev, action);
- dm_put_device(ti, dev);
-
out:
mutex_unlock(&m->work_mutex);
return r;