for (map<int, Capability>::iterator it = in->client_caps.begin();
it != in->client_caps.end();
it++) {
- if (it->second.issued() != (it->second.wanted() & allowed)) {
+ if (it->second.pending() != (it->second.wanted() & allowed)) {
// issue
nissued++;
lock->set_state(LOCK_SYNC);
// waiters?
- lock->finish_waiters(SimpleLock::WAIT_STABLE);
+ lock->finish_waiters(SimpleLock::WAIT_RD|SimpleLock::WAIT_STABLE);
}
void Locker::simple_lock(SimpleLock *lock)
return true;
}
- // can't read, and replicated.
- assert(!lock->get_parent()->is_auth());
-
// wait!
dout(7) << "simple_rdlock_start waiting on " << *lock << " on " << *lock->get_parent() << endl;
lock->add_waiter(SimpleLock::WAIT_RD, new C_MDS_RetryRequest(mdcache, mdr));
// auth rep
#define LOCK_SYNC 1 // AR R . R .
#define LOCK_LOCK 2 // AR R W . .
-#define LOCK_GLOCKR 3 // AR R . . .
+#define LOCK_GLOCKR -3 // AR R . . .
inline const char *get_simplelock_state_name(int n) {
switch (n) {
parent->encode_lock_state(type, bl);
}
void finish_waiters(int mask, int r=0) {
- parent->finish_waiting(mask < wait_offset, r);
+ parent->finish_waiting(mask << wait_offset, r);
}
void add_waiter(int mask, Context *c) {
- parent->add_waiter(mask < wait_offset, c);
+ parent->add_waiter(mask << wait_offset, c);
}
bool is_waiter_for(int mask) {
- return parent->is_waiter_for(mask < wait_offset);
+ return parent->is_waiter_for(mask << wait_offset);
}