mirror of
https://github.com/ceph/ceph
synced 2025-03-30 07:19:14 +00:00
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:
parent
019c0522f0
commit
de8a55e500
@ -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;
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user