Commit 90a4323c authored by Mike Snitzer's avatar Mike Snitzer

dm path selector: remove 'repeat_count' return from .select_path hook

If a path selector has any use for a repeat_count it should be handled
locally and not depend on the dm-mpath core to be concerned with it.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 9659f811
...@@ -318,9 +318,8 @@ static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg, ...@@ -318,9 +318,8 @@ static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg,
size_t nr_bytes) size_t nr_bytes)
{ {
struct dm_path *path; struct dm_path *path;
unsigned repeat_count;
path = pg->ps.type->select_path(&pg->ps, &repeat_count, nr_bytes); path = pg->ps.type->select_path(&pg->ps, nr_bytes);
if (!path) if (!path)
return -ENXIO; return -ENXIO;
......
...@@ -50,13 +50,8 @@ struct path_selector_type { ...@@ -50,13 +50,8 @@ struct path_selector_type {
/* /*
* Chooses a path for this io, if no paths are available then * Chooses a path for this io, if no paths are available then
* NULL will be returned. * NULL will be returned.
*
* repeat_count is the number of times to use the path before
* calling the function again. 0 means don't call it again unless
* the path fails.
*/ */
struct dm_path *(*select_path) (struct path_selector *ps, struct dm_path *(*select_path) (struct path_selector *ps,
unsigned *repeat_count,
size_t nr_bytes); size_t nr_bytes);
/* /*
......
...@@ -184,8 +184,7 @@ static int ql_reinstate_path(struct path_selector *ps, struct dm_path *path) ...@@ -184,8 +184,7 @@ static int ql_reinstate_path(struct path_selector *ps, struct dm_path *path)
/* /*
* Select a path having the minimum number of in-flight I/Os * Select a path having the minimum number of in-flight I/Os
*/ */
static struct dm_path *ql_select_path(struct path_selector *ps, static struct dm_path *ql_select_path(struct path_selector *ps, size_t nr_bytes)
unsigned *repeat_count, size_t nr_bytes)
{ {
struct selector *s = ps->context; struct selector *s = ps->context;
struct path_info *pi = NULL, *best = NULL; struct path_info *pi = NULL, *best = NULL;
...@@ -211,8 +210,6 @@ static struct dm_path *ql_select_path(struct path_selector *ps, ...@@ -211,8 +210,6 @@ static struct dm_path *ql_select_path(struct path_selector *ps,
if (!best) if (!best)
goto out; goto out;
*repeat_count = best->repeat_count;
ret = best->path; ret = best->path;
out: out:
spin_unlock_irqrestore(&s->lock, flags); spin_unlock_irqrestore(&s->lock, flags);
......
...@@ -178,8 +178,7 @@ static int rr_reinstate_path(struct path_selector *ps, struct dm_path *p) ...@@ -178,8 +178,7 @@ static int rr_reinstate_path(struct path_selector *ps, struct dm_path *p)
return 0; return 0;
} }
static struct dm_path *rr_select_path(struct path_selector *ps, static struct dm_path *rr_select_path(struct path_selector *ps, size_t nr_bytes)
unsigned *repeat_count, size_t nr_bytes)
{ {
unsigned long flags; unsigned long flags;
struct selector *s = ps->context; struct selector *s = ps->context;
...@@ -189,7 +188,6 @@ static struct dm_path *rr_select_path(struct path_selector *ps, ...@@ -189,7 +188,6 @@ static struct dm_path *rr_select_path(struct path_selector *ps,
if (!list_empty(&s->valid_paths)) { if (!list_empty(&s->valid_paths)) {
pi = list_entry(s->valid_paths.next, struct path_info, list); pi = list_entry(s->valid_paths.next, struct path_info, list);
list_move_tail(&pi->list, &s->valid_paths); list_move_tail(&pi->list, &s->valid_paths);
*repeat_count = pi->repeat_count;
} }
spin_unlock_irqrestore(&s->lock, flags); spin_unlock_irqrestore(&s->lock, flags);
......
...@@ -271,8 +271,7 @@ static int st_compare_load(struct path_info *pi1, struct path_info *pi2, ...@@ -271,8 +271,7 @@ static int st_compare_load(struct path_info *pi1, struct path_info *pi2,
return pi2->relative_throughput - pi1->relative_throughput; return pi2->relative_throughput - pi1->relative_throughput;
} }
static struct dm_path *st_select_path(struct path_selector *ps, static struct dm_path *st_select_path(struct path_selector *ps, size_t nr_bytes)
unsigned *repeat_count, size_t nr_bytes)
{ {
struct selector *s = ps->context; struct selector *s = ps->context;
struct path_info *pi = NULL, *best = NULL; struct path_info *pi = NULL, *best = NULL;
...@@ -293,8 +292,6 @@ static struct dm_path *st_select_path(struct path_selector *ps, ...@@ -293,8 +292,6 @@ static struct dm_path *st_select_path(struct path_selector *ps,
if (!best) if (!best)
goto out; goto out;
*repeat_count = best->repeat_count;
ret = best->path; ret = best->path;
out: out:
spin_unlock_irqrestore(&s->lock, flags); spin_unlock_irqrestore(&s->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment