This patch moves 'is_active' from struct dm_path to struct pgpath
as it does not need exporting.
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
struct list_head list;
struct priority_group *pg; /* Owning PG */
struct list_head list;
struct priority_group *pg; /* Owning PG */
+ unsigned is_active; /* Path status */
unsigned fail_count; /* Cumulative failure count */
struct dm_path path;
unsigned fail_count; /* Cumulative failure count */
struct dm_path path;
struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
if (pgpath)
struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
if (pgpath)
- pgpath->path.is_active = 1;
spin_lock_irqsave(&m->lock, flags);
spin_lock_irqsave(&m->lock, flags);
- if (!pgpath->path.is_active)
+ if (!pgpath->is_active)
goto out;
DMWARN("Failing path %s.", pgpath->path.dev->name);
pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
goto out;
DMWARN("Failing path %s.", pgpath->path.dev->name);
pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
- pgpath->path.is_active = 0;
pgpath->fail_count++;
m->nr_valid_paths--;
pgpath->fail_count++;
m->nr_valid_paths--;
spin_lock_irqsave(&m->lock, flags);
spin_lock_irqsave(&m->lock, flags);
- if (pgpath->path.is_active)
goto out;
if (!pgpath->pg->ps.type->reinstate_path) {
goto out;
if (!pgpath->pg->ps.type->reinstate_path) {
- pgpath->path.is_active = 1;
m->current_pgpath = NULL;
if (!m->nr_valid_paths++ && m->queue_size)
m->current_pgpath = NULL;
if (!m->nr_valid_paths++ && m->queue_size)
list_for_each_entry(p, &pg->pgpaths, list) {
DMEMIT("%s %s %u ", p->path.dev->name,
list_for_each_entry(p, &pg->pgpaths, list) {
DMEMIT("%s %s %u ", p->path.dev->name,
- p->path.is_active ? "A" : "F",
+ p->is_active ? "A" : "F",
p->fail_count);
if (pg->ps.type->status)
sz += pg->ps.type->status(&pg->ps,
p->fail_count);
if (pg->ps.type->status)
sz += pg->ps.type->status(&pg->ps,
struct dm_path {
struct dm_dev *dev; /* Read-only */
struct dm_path {
struct dm_dev *dev; /* Read-only */
- unsigned is_active; /* Read-only */
-
void *pscontext; /* For path-selector use */
};
void *pscontext; /* For path-selector use */
};