Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186428
b: refs/heads/master
c: fb61264
h: refs/heads/master
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Mar 6, 2010
1 parent 6a97cfa commit 1882285
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2bded7bd7e8b12a913b0b58167a48220560e1514
refs/heads/master: fb61264297ca42a2a132f0433f75ccf7fd304ac6
31 changes: 19 additions & 12 deletions trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,21 @@ static void free_multipath(struct multipath *m)
* Path selection
*-----------------------------------------------*/

static void __pg_init_all_paths(struct multipath *m)
{
struct pgpath *pgpath;

m->pg_init_count++;
m->pg_init_required = 0;
list_for_each_entry(pgpath, &m->current_pg->pgpaths, list) {
/* Skip failed paths */
if (!pgpath->is_active)
continue;
if (queue_work(kmpath_handlerd, &pgpath->activate_path))
m->pg_init_in_progress++;
}
}

static void __switch_pg(struct multipath *m, struct pgpath *pgpath)
{
m->current_pg = pgpath->pg;
Expand Down Expand Up @@ -439,7 +454,7 @@ static void process_queued_ios(struct work_struct *work)
{
struct multipath *m =
container_of(work, struct multipath, process_queued_ios);
struct pgpath *pgpath = NULL, *tmp;
struct pgpath *pgpath = NULL;
unsigned must_queue = 1;
unsigned long flags;

Expand All @@ -457,17 +472,9 @@ static void process_queued_ios(struct work_struct *work)
(!pgpath && !m->queue_if_no_path))
must_queue = 0;

if (m->pg_init_required && !m->pg_init_in_progress && pgpath) {
m->pg_init_count++;
m->pg_init_required = 0;
list_for_each_entry(tmp, &pgpath->pg->pgpaths, list) {
/* Skip failed paths */
if (!tmp->is_active)
continue;
if (queue_work(kmpath_handlerd, &tmp->activate_path))
m->pg_init_in_progress++;
}
}
if (m->pg_init_required && !m->pg_init_in_progress && pgpath)
__pg_init_all_paths(m);

out:
spin_unlock_irqrestore(&m->lock, flags);
if (!must_queue)
Expand Down

0 comments on commit 1882285

Please sign in to comment.