]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mds/locks.h
2 #ifndef CEPH_MDS_LOCKS_H
3 #define CEPH_MDS_LOCKS_H
6 int next
; // 0 if stable
10 char can_read_projected
;
13 char can_force_wrlock
;
23 const struct sm_state_t
*states
;
24 int allowed_ever_auth
;
25 int allowed_ever_replica
;
30 #define ANY 1 // auth or replica
31 #define AUTH 2 // auth only
32 #define XCL 3 // auth or exclusive client
33 //#define FW 4 // fw to auth, if replica
34 #define REQ 5 // req state change from auth, if replica
36 extern const struct sm_t sm_simplelock
;
37 extern const struct sm_t sm_filelock
;
38 extern const struct sm_t sm_scatterlock
;
39 extern const struct sm_t sm_locallock
;
49 LOCK_SYNC
, // AR R . RD L . / C . R RD L . / C .
50 LOCK_LOCK
, // AR R . .. . X / . . . .. . . / . .
52 LOCK_PREXLOCK
, // A . . .. . . / . . (lock)
53 LOCK_XLOCK
, // A . . .. . . / . . (lock)
54 LOCK_XLOCKDONE
, // A r p rd l x / . . (lock) <-- by same client only!!
55 LOCK_XLOCKSNAP
, // also revoke Fb
58 LOCK_SYNC_LOCK
, // AR R . .. . . / . . R .. . . / . .
59 LOCK_LOCK_SYNC
, // A R p rd l . / . . (lock) <-- lc by same client only
61 LOCK_EXCL
, // A . . .. . . / c x * (lock)
62 LOCK_EXCL_SYNC
, // A . . .. . . / c . * (lock)
63 LOCK_EXCL_LOCK
, // A . . .. . . / . . (lock)
64 LOCK_SYNC_EXCL
, // Ar R . .. . . / c . * (sync->lock)
65 LOCK_LOCK_EXCL
, // A R . .. . . / . . (lock)
67 LOCK_REMOTEXLOCK
, // on NON-auth
101 // -------------------------
105 #define LOCK_AC_SYNC -1
106 #define LOCK_AC_MIX -2
107 #define LOCK_AC_LOCK -3
108 #define LOCK_AC_LOCKFLUSHED -4
111 #define LOCK_AC_SYNCACK 1
112 #define LOCK_AC_MIXACK 2
113 #define LOCK_AC_LOCKACK 3
115 #define LOCK_AC_REQSCATTER 7
116 #define LOCK_AC_REQUNSCATTER 8
117 #define LOCK_AC_NUDGE 9
118 #define LOCK_AC_REQRDLOCK 10
120 #define LOCK_AC_FOR_REPLICA(a) ((a) < 0)
121 #define LOCK_AC_FOR_AUTH(a) ((a) > 0)
124 static inline const char *get_lock_action_name(int a
) {
126 case LOCK_AC_SYNC
: return "sync";
127 case LOCK_AC_MIX
: return "mix";
128 case LOCK_AC_LOCK
: return "lock";
129 case LOCK_AC_LOCKFLUSHED
: return "lockflushed";
131 case LOCK_AC_SYNCACK
: return "syncack";
132 case LOCK_AC_MIXACK
: return "mixack";
133 case LOCK_AC_LOCKACK
: return "lockack";
135 case LOCK_AC_REQSCATTER
: return "reqscatter";
136 case LOCK_AC_REQUNSCATTER
: return "requnscatter";
137 case LOCK_AC_NUDGE
: return "nudge";
138 case LOCK_AC_REQRDLOCK
: return "reqrdlock";
139 default: return "???";