LGTM.

On Mon, Mar 3, 2014 at 2:48 PM, Klaus Aehlig <[email protected]> wrote:

> Make WConfD provide a function to opportunistically allocate
> locks.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/WConfd/Core.hs | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/Ganeti/WConfd/Core.hs b/src/Ganeti/WConfd/Core.hs
> index 0c2ac6c..8f99bdd 100644
> --- a/src/Ganeti/WConfd/Core.hs
> +++ b/src/Ganeti/WConfd/Core.hs
> @@ -77,6 +77,15 @@ intersectLocks :: JobId -> FilePath -> [GanetiLocks] ->
> WConfdMonad ()
>  intersectLocks jid fpath =
>   modifyLockAllocation_ . L.intersectLocks (jid,fpath)
>
> +-- | Opportunistically allocate locks for a given owner.
> +opportunisticLockUnion :: JobId -> FilePath
> +                       -> [(GanetiLocks, L.OwnerState)]
> +                       -> WConfdMonad [GanetiLocks]
> +opportunisticLockUnion jid fpath req =
> +  liftM S.toList
> +  . modifyLockAllocation
> +  $ L.opportunisticLockUnion (jid, fpath) req
> +
>  -- * The list of all functions exported to RPC.
>
>  exportedFunctions :: [Name]
> @@ -87,4 +96,5 @@ exportedFunctions = [ 'echo
>                      , 'updateLocks
>                      , 'freeLocks
>                      , 'intersectLocks
> +                    , 'opportunisticLockUnion
>                      ]
> --
> 1.9.0.279.gdc9e3eb
>
>

Reply via email to