mds: add locallock statemachine

This is just for consistency; it's trivial.  We lost the get_sm()
pointer test, though.
This commit is contained in:
Sage Weil 2010-03-11 09:41:30 -08:00
parent 019c0522f0
commit de8a55e500
3 changed files with 18 additions and 2 deletions

View File

@ -66,6 +66,9 @@ struct LockType {
case CEPH_LOCK_IFILE:
sm = &sm_filelock;
break;
case CEPH_LOCK_IVERSION:
sm = &sm_locallock;
break;
default:
sm = 0;
}
@ -252,7 +255,7 @@ public:
}
bool is_stable() {
return !get_sm() || get_sm()->states[state].next == 0;
return get_sm()->states[state].next == 0;
}
int get_next_state() {
return get_sm()->states[state].next;

View File

@ -131,3 +131,16 @@ struct sm_t sm_filelock = {
.can_remote_xlock = 0,
};
struct sm_state_t locallock[LOCK_MAX] = {
// stable loner rep state r rp rd wr l x caps(any,loner,xlocker,replica)
[LOCK_LOCK] = { 0, false, LOCK_LOCK, ANY, 0, ANY, 0, ANY, 0, 0,0,0,0 },
};
struct sm_t sm_locallock = {
.states = locallock,
.allowed_ever_auth = 0,
.allowed_ever_replica = 0,
.careful = 0,
.can_remote_xlock = 0,
};

View File

@ -34,7 +34,7 @@ struct sm_t {
extern struct sm_t sm_simplelock;
extern struct sm_t sm_filelock;
extern struct sm_t sm_scatterlock;
extern struct sm_t sm_locallock;