}
}
+ bool remove_all_from (client_t client) {
+ bool cleared_any = false;
+ if (client_held_lock_counts.count(client)) {
+ remove_all_from(client, held_locks);
+ client_held_lock_counts[client] = 0;
+ cleared_any = true;
+ }
+ if (client_waiting_lock_counts.count(client)) {
+ remove_all_from(client, waiting_locks);
+ client_waiting_lock_counts[client] = 0;
+ }
+ return cleared_any;
+ }
+
private:
/**
* Adjust old locks owned by a single process so that process can set
}
}
+ //this won't reset the counter map value, do that yourself
+ void remove_all_from(client_t client, multimap<__u64, ceph_filelock>& locks) {
+ multimap<__u64, ceph_filelock>::iterator iter = locks.begin();
+ while (iter != locks.end()) {
+ if (iter->second.client == client) {
+ locks.erase(iter++);
+ } else ++iter;
+ }
+ }
+
//obviously, this is a skeleton for compilation purposes.
multimap<__u64, ceph_filelock>::iterator
find_specific_elem(ceph_filelock *elem, multimap<__u64, ceph_filelock>& map) {