Set pneed_issue (or issue ourselves) whenever we jump directly to the
target lock state. Make sure we only do it if there are caps (cap shift)
for this particular lock.
Part of fix for #1084.
Signed-off-by: Sage Weil <sage@newdream.net>
}
lock->set_state(LOCK_SYNC);
lock->finish_waiters(SimpleLock::WAIT_RD|SimpleLock::WAIT_STABLE);
+ if (in) {
+ if (need_issue)
+ *need_issue = true;
+ else
+ issue_caps(in);
+ }
return true;
}
} else {
lock->set_state(LOCK_EXCL);
lock->finish_waiters(SimpleLock::WAIT_WR|SimpleLock::WAIT_STABLE);
+ if (in) {
+ if (need_issue)
+ *need_issue = true;
+ else
+ issue_caps(in);
+ }
}
}
// do tempsync
lock->set_state(LOCK_TSYN);
lock->finish_waiters(ScatterLock::WAIT_RD|ScatterLock::WAIT_STABLE);
+ if (lock->get_cap_shift()) {
+ if (need_issue)
+ *need_issue = true;
+ else
+ issue_caps(in);
+ }
}
}
// change lock
lock->set_state(LOCK_MIX);
lock->clear_scatter_wanted();
- if (need_issue)
- *need_issue = true;
- else
- issue_caps(in);
+ if (lock->get_cap_shift()) {
+ if (need_issue)
+ *need_issue = true;
+ else
+ issue_caps(in);
+ }
} else {
// gather?
switch (lock->get_state()) {