]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | Subject: dm mpath: remove is_active from struct dm_path |
2 | From: Hannes Reinecke <hare@suse.de> | |
3 | Date: Fri Oct 24 13:31:15 2008 +0200: | |
4 | Git: 1271668e1c80210efa60c51a52b72bfb587eebe7 | |
5 | ||
6 | This patch moves 'is_active' from struct dm_path to struct pgpath | |
7 | as it does not need exporting. | |
8 | ||
9 | Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | |
10 | Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> | |
11 | Signed-off-by: Alasdair G Kergon <agk@redhat.com> | |
12 | ||
13 | Conflicts: | |
14 | ||
15 | drivers/md/dm-mpath.c | |
16 | ||
17 | --- | |
18 | drivers/md/dm-mpath.c | 13 +++++++------ | |
19 | drivers/md/dm-mpath.h | 2 -- | |
20 | 2 files changed, 7 insertions(+), 8 deletions(-) | |
21 | ||
22 | --- a/drivers/md/dm-mpath.c | |
23 | +++ b/drivers/md/dm-mpath.c | |
24 | @@ -28,6 +28,7 @@ struct pgpath { | |
25 | struct list_head list; | |
26 | ||
27 | struct priority_group *pg; /* Owning PG */ | |
28 | + unsigned is_active; /* Path status */ | |
29 | unsigned fail_count; /* Cumulative failure count */ | |
30 | ||
31 | struct dm_path path; | |
32 | @@ -122,7 +123,7 @@ static struct pgpath *alloc_pgpath(void) | |
33 | struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); | |
34 | ||
35 | if (pgpath) { | |
36 | - pgpath->path.is_active = 1; | |
37 | + pgpath->is_active = 1; | |
38 | INIT_WORK(&pgpath->deactivate_path, deactivate_path); | |
39 | } | |
40 | ||
41 | @@ -869,13 +870,13 @@ static int fail_path(struct pgpath *pgpa | |
42 | ||
43 | spin_lock_irqsave(&m->lock, flags); | |
44 | ||
45 | - if (!pgpath->path.is_active) | |
46 | + if (!pgpath->is_active) | |
47 | goto out; | |
48 | ||
49 | DMWARN("Failing path %s.", pgpath->path.dev->name); | |
50 | ||
51 | pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); | |
52 | - pgpath->path.is_active = 0; | |
53 | + pgpath->is_active = 0; | |
54 | pgpath->fail_count++; | |
55 | ||
56 | m->nr_valid_paths--; | |
57 | @@ -906,7 +907,7 @@ static int reinstate_path(struct pgpath | |
58 | ||
59 | spin_lock_irqsave(&m->lock, flags); | |
60 | ||
61 | - if (pgpath->path.is_active) | |
62 | + if (pgpath->is_active) | |
63 | goto out; | |
64 | ||
65 | if (!pgpath->pg->ps.type->reinstate_path) { | |
66 | @@ -920,7 +921,7 @@ static int reinstate_path(struct pgpath | |
67 | if (r) | |
68 | goto out; | |
69 | ||
70 | - pgpath->path.is_active = 1; | |
71 | + pgpath->is_active = 1; | |
72 | ||
73 | m->current_pgpath = NULL; | |
74 | if (!m->nr_valid_paths++ && m->queue_size) | |
75 | @@ -1295,7 +1296,7 @@ static int multipath_status(struct dm_ta | |
76 | ||
77 | list_for_each_entry(p, &pg->pgpaths, list) { | |
78 | DMEMIT("%s %s %u ", p->path.dev->name, | |
79 | - p->path.is_active ? "A" : "F", | |
80 | + p->is_active ? "A" : "F", | |
81 | p->fail_count); | |
82 | if (pg->ps.type->status) | |
83 | sz += pg->ps.type->status(&pg->ps, | |
84 | --- a/drivers/md/dm-mpath.h | |
85 | +++ b/drivers/md/dm-mpath.h | |
86 | @@ -13,8 +13,6 @@ struct dm_dev; | |
87 | ||
88 | struct dm_path { | |
89 | struct dm_dev *dev; /* Read-only */ | |
90 | - unsigned is_active; /* Read-only */ | |
91 | - | |
92 | void *pscontext; /* For path-selector use */ | |
93 | }; | |
94 |