Revision 22f3fc92
b/src/Ganeti/Locking/Allocation.hs | ||
---|---|---|
29 | 29 |
, OwnerState(..) |
30 | 30 |
, lockOwners |
31 | 31 |
, listLocks |
32 |
, listAllLocks |
|
32 | 33 |
, holdsLock |
33 | 34 |
, LockRequest(..) |
34 | 35 |
, requestExclusive |
... | ... | |
126 | 127 |
listLocks :: Ord b => b -> LockAllocation a b -> M.Map a OwnerState |
127 | 128 |
listLocks owner = fromMaybe M.empty . M.lookup owner . laOwned |
128 | 129 |
|
130 |
-- | List all locks currently (directly or indirectly) owned by someone. |
|
131 |
listAllLocks :: Ord b => LockAllocation a b -> [a] |
|
132 |
listAllLocks = M.keys . laLocks |
|
133 |
|
|
129 | 134 |
-- | Returns 'True' if the given owner holds the given lock at the given |
130 | 135 |
-- ownership level or higher. This means that querying for a shared lock |
131 | 136 |
-- returns 'True' of the owner holds the lock in shared or exlusive mode. |
Also available in: Unified diff