Slightly restructure the final loop in rman_reserve_resource_bound().

Replace with the existing loop termination test with a similar
condition from the nested "if" that may terminate the loop a bit
sooner, but still not too early.   This condition can then be removed
from the nested "if".  Relocate an operator to be style(9) compliant.

MFC after:	3 days
This commit is contained in:
Don Lewis 2014-05-19 04:44:27 +00:00
parent a4d6aee71d
commit c201b03fc3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266426

View File

@ -602,13 +602,10 @@ rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end,
if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0)
goto out;
for (s = r; s; s = TAILQ_NEXT(s, r_link)) {
if (s->r_start > end)
break;
if ((s->r_flags & flags) != flags)
continue;
if (s->r_start >= start && s->r_end <= end
&& (s->r_end - s->r_start + 1) == count &&
for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) {
if ((s->r_flags & flags) == flags &&
s->r_start >= start &&
(s->r_end - s->r_start + 1) == count &&
(s->r_start & amask) == 0 &&
((s->r_start ^ s->r_end) & bmask) == 0) {
rv = int_alloc_resource(M_NOWAIT);