bool need_issue = false;
int loner_issued = 0, other_issued = 0, xlocker_issued = 0;
- if (caps) {
+ if (caps && in->is_head()) {
in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued, lock->get_cap_shift(), 3);
dout(10) << " next state is " << lock->get_state_name(next)
<< " issued/allows loner " << gcap_string(loner_issued)
// drop loner before doing waiters
if (caps &&
- in->is_auth() && in->get_wanted_loner() != in->get_loner()) {
+ in->is_head() &&
+ in->is_auth() &&
+ in->get_wanted_loner() != in->get_loner()) {
dout(10) << " trying to drop loner" << dendl;
if (in->try_drop_loner()) {
dout(10) << " dropped loner" << dendl;
else
lock->finish_waiters(SimpleLock::WAIT_STABLE|SimpleLock::WAIT_WR|SimpleLock::WAIT_RD|SimpleLock::WAIT_XLOCK);
- if (caps)
+ if (caps && in->is_head())
need_issue = true;
if (lock->get_parent()->is_auth() &&
dout(10) << "eval " << mask << " " << *in << dendl;
// choose loner?
- if (in->is_auth()) {
+ if (in->is_auth() && in->is_head()) {
if (in->choose_ideal_loner() >= 0) {
if (in->try_set_loner()) {
dout(10) << "eval set loner to client" << in->get_loner() << dendl;
eval_any(&in->policylock, &need_issue);
// drop loner?
- if (in->is_auth() && in->get_wanted_loner() != in->get_loner()) {
+ if (in->is_auth() && in->is_head() && in->get_wanted_loner() != in->get_loner()) {
dout(10) << " trying to drop loner" << dendl;
if (in->try_drop_loner()) {
dout(10) << " dropped loner" << dendl;
try_eval(lock, &do_issue);
if (do_issue) {
- if (pneed_issue)
- *pneed_issue = true;
- else
- issue_caps((CInode*)lock->get_parent());
+ CInode *in = (CInode*)lock->get_parent();
+ if (in->is_head()) {
+ if (pneed_issue)
+ *pneed_issue = true;
+ else
+ issue_caps(in);
+ }
}
}
gather++;
}
- if (in) {
+ if (in && in->is_head()) {
if (in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
}
lock->set_state(LOCK_SYNC);
lock->finish_waiters(SimpleLock::WAIT_RD|SimpleLock::WAIT_STABLE);
- if (in) {
+ if (in && in->is_head()) {
if (need_issue)
*need_issue = true;
else
gather++;
}
- if (in) {
+ if (in && in->is_head()) {
if (in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
}
if (lock->is_rdlocked())
gather++;
- if (in) {
+ if (in && in->is_head()) {
if (in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
if (lock->is_wrlocked())
gather++;
- if (in) {
+ if (in && in->is_head()) {
if (in->issued_caps_need_gather(lock)) {
issue_caps(in);
gather++;
gather++;
if (lock->get_cap_shift() &&
+ in->is_head() &&
in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
gather++;
}
if (lock->get_cap_shift() &&
+ in->is_head() &&
in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
revoke_client_leases(lock);
gather++;
}
- if (in->issued_caps_need_gather(lock)) {
+ if (in->is_head() &&
+ in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
else
if (lock->is_xlocked())
gather++;
- if (in->issued_caps_need_gather(lock)) {
+ if (in->is_head() &&
+ in->issued_caps_need_gather(lock)) {
if (need_issue)
*need_issue = true;
else
gather++;
}
*/
- if (in->issued_caps_need_gather(lock)) {
+ if (in->is_head() &&
+ in->issued_caps_need_gather(lock)) {
issue_caps(in);
gather++;
}