client_held_lock_counts.erase(old_lock_client);
}
}
-
- /* okay, we've removed the locks, but removing them might allow some
- * other waiting locks to come through */
- if (get_waiting_overlaps(removal_lock, crossed_waiting_locks)) {
- /*let's do this the SUPER lazy way for now. Should work out something
- that's slightly less slow and wasteful, though.
- 1) Remove lock from waiting_locks.
- 2) attempt to insert lock via add_lock
- 3) Add to success list if we get back "true"
-
- In the future, should probably set this up to detect some
- guaranteed blocks and do fewer map lookups.
- */
- for (list<multimap<uint64_t, ceph_filelock>::iterator>::iterator
- iter = crossed_waiting_locks.begin();
- iter != crossed_waiting_locks.end();
- ++iter) {
- ceph_filelock cur_lock = (*iter)->second;
- waiting_locks.erase(*iter);
- --client_waiting_lock_counts[(client_t)cur_lock.client];
- if (!client_waiting_lock_counts[(client_t)cur_lock.client]) {
- client_waiting_lock_counts.erase((client_t)cur_lock.client);
- }
- if (add_lock(cur_lock, true))
- activated_locks.push_back(cur_lock);
- }
- }
}
bool ceph_lock_state_t::remove_all_from (client_t client)