aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2008-10-10 08:36:58 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-10-10 08:36:58 -0400
commit6680073d3ec7c6dbdbf77870bf1fea869767d779 (patch)
tree3e5417645e04b4e33feaec38e73f2e54509d16d0
parent01460f3520c100010aacc8f8500cafcb17ce4665 (diff)
dm mpath: remove is_active from struct dm_path
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>
-rw-r--r--drivers/md/dm-mpath.c13
-rw-r--r--drivers/md/dm-mpath.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index c2ff77d77a5e..b2ab8489d0eb 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -30,6 +30,7 @@ struct pgpath {
30 struct list_head list; 30 struct list_head list;
31 31
32 struct priority_group *pg; /* Owning PG */ 32 struct priority_group *pg; /* Owning PG */
33 unsigned is_active; /* Path status */
33 unsigned fail_count; /* Cumulative failure count */ 34 unsigned fail_count; /* Cumulative failure count */
34 35
35 struct dm_path path; 36 struct dm_path path;
@@ -123,7 +124,7 @@ static struct pgpath *alloc_pgpath(void)
123 struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); 124 struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
124 125
125 if (pgpath) 126 if (pgpath)
126 pgpath->path.is_active = 1; 127 pgpath->is_active = 1;
127 128
128 return pgpath; 129 return pgpath;
129} 130}
@@ -854,13 +855,13 @@ static int fail_path(struct pgpath *pgpath)
854 855
855 spin_lock_irqsave(&m->lock, flags); 856 spin_lock_irqsave(&m->lock, flags);
856 857
857 if (!pgpath->path.is_active) 858 if (!pgpath->is_active)
858 goto out; 859 goto out;
859 860
860 DMWARN("Failing path %s.", pgpath->path.dev->name); 861 DMWARN("Failing path %s.", pgpath->path.dev->name);
861 862
862 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); 863 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
863 pgpath->path.is_active = 0; 864 pgpath->is_active = 0;
864 pgpath->fail_count++; 865 pgpath->fail_count++;
865 866
866 m->nr_valid_paths--; 867 m->nr_valid_paths--;
@@ -890,7 +891,7 @@ static int reinstate_path(struct pgpath *pgpath)
890 891
891 spin_lock_irqsave(&m->lock, flags); 892 spin_lock_irqsave(&m->lock, flags);
892 893
893 if (pgpath->path.is_active) 894 if (pgpath->is_active)
894 goto out; 895 goto out;
895 896
896 if (!pgpath->pg->ps.type->reinstate_path) { 897 if (!pgpath->pg->ps.type->reinstate_path) {
@@ -904,7 +905,7 @@ static int reinstate_path(struct pgpath *pgpath)
904 if (r) 905 if (r)
905 goto out; 906 goto out;
906 907
907 pgpath->path.is_active = 1; 908 pgpath->is_active = 1;
908 909
909 m->current_pgpath = NULL; 910 m->current_pgpath = NULL;
910 if (!m->nr_valid_paths++ && m->queue_size) 911 if (!m->nr_valid_paths++ && m->queue_size)
@@ -1292,7 +1293,7 @@ static int multipath_status(struct dm_target *ti, status_type_t type,
1292 1293
1293 list_for_each_entry(p, &pg->pgpaths, list) { 1294 list_for_each_entry(p, &pg->pgpaths, list) {
1294 DMEMIT("%s %s %u ", p->path.dev->name, 1295 DMEMIT("%s %s %u ", p->path.dev->name,
1295 p->path.is_active ? "A" : "F", 1296 p->is_active ? "A" : "F",
1296 p->fail_count); 1297 p->fail_count);
1297 if (pg->ps.type->status) 1298 if (pg->ps.type->status)
1298 sz += pg->ps.type->status(&pg->ps, 1299 sz += pg->ps.type->status(&pg->ps,
diff --git a/drivers/md/dm-mpath.h b/drivers/md/dm-mpath.h
index c198b856a452..e230f7196259 100644
--- a/drivers/md/dm-mpath.h
+++ b/drivers/md/dm-mpath.h
@@ -13,8 +13,6 @@ struct dm_dev;
13 13
14struct dm_path { 14struct dm_path {
15 struct dm_dev *dev; /* Read-only */ 15 struct dm_dev *dev; /* Read-only */
16 unsigned is_active; /* Read-only */
17
18 void *pscontext; /* For path-selector use */ 16 void *pscontext; /* For path-selector use */
19}; 17};
20 18