LUs may decide to acquire locks in an opportunistic way. In this
case, also allow them to specify the number of locks the which to
acquire at least.

Signed-off-by: Klaus Aehlig <[email protected]>
Reviewed-by: Hrvoje Ribicic <[email protected]>

Cherry-picked from 24ef93b37ba2411e86f06e045d523a8769372335.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/cmdlib/base.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/cmdlib/base.py b/lib/cmdlib/base.py
index 4af879f..2f99f06 100644
--- a/lib/cmdlib/base.py
+++ b/lib/cmdlib/base.py
@@ -131,6 +131,7 @@ class LogicalUnit(object):
     self.needed_locks = None
     self.share_locks = dict.fromkeys(locking.LEVELS, 0)
     self.opportunistic_locks = dict.fromkeys(locking.LEVELS, False)
+    self.opportunistic_locks_count = dict.fromkeys(locking.LEVELS, 1)
 
     self.add_locks = {}
 
-- 
2.0.0.526.g5318336

Reply via email to