|
|
@ -2872,12 +2872,15 @@ static inline struct pool *select_pool(bool lagging) |
|
|
|
|
|
|
|
|
|
|
|
cp = current_pool(); |
|
|
|
cp = current_pool(); |
|
|
|
|
|
|
|
|
|
|
|
if (pool_strategy == POOL_BALANCE) |
|
|
|
if (pool_strategy == POOL_BALANCE) { |
|
|
|
return select_balanced(cp); |
|
|
|
pool = select_balanced(cp); |
|
|
|
|
|
|
|
goto out; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pool_strategy != POOL_LOADBALANCE && (!lagging || opt_fail_only)) |
|
|
|
if (pool_strategy != POOL_LOADBALANCE && (!lagging || opt_fail_only)) { |
|
|
|
pool = cp; |
|
|
|
pool = cp; |
|
|
|
else |
|
|
|
goto out; |
|
|
|
|
|
|
|
} else |
|
|
|
pool = NULL; |
|
|
|
pool = NULL; |
|
|
|
|
|
|
|
|
|
|
|
/* Try to find the first pool in the rotation that is usable */ |
|
|
|
/* Try to find the first pool in the rotation that is usable */ |
|
|
@ -2916,7 +2919,7 @@ static inline struct pool *select_pool(bool lagging) |
|
|
|
/* If still nothing is usable, use the current pool */ |
|
|
|
/* If still nothing is usable, use the current pool */ |
|
|
|
if (!pool) |
|
|
|
if (!pool) |
|
|
|
pool = cp; |
|
|
|
pool = cp; |
|
|
|
|
|
|
|
out: |
|
|
|
applog(LOG_DEBUG, "Selecting pool %d for work", pool->pool_no); |
|
|
|
applog(LOG_DEBUG, "Selecting pool %d for work", pool->pool_no); |
|
|
|
return pool; |
|
|
|
return pool; |
|
|
|
} |
|
|
|
} |
|
|
|