Add kick function for cleaner
ocf_kick_cleaner() allows to perfom cleaning immediately. Nop cleaning policy now returns new 'OCF_CLEANER_DISABLE' macro which indicates that cleaing shouldn't be performed. To enable it back, ocf_kick_cleaner() should be called. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
@@ -9,9 +9,10 @@ from .shared import SharedOcfObject
|
||||
|
||||
class CleanerOps(Structure):
|
||||
INIT = CFUNCTYPE(c_int, c_void_p)
|
||||
KICK = CFUNCTYPE(None, c_void_p)
|
||||
STOP = CFUNCTYPE(None, c_void_p)
|
||||
|
||||
_fields_ = [("init", INIT), ("stop", STOP)]
|
||||
_fields_ = [("init", INIT), ("kick", KICK), ("stop", STOP)]
|
||||
|
||||
|
||||
class Cleaner(SharedOcfObject):
|
||||
@@ -24,13 +25,18 @@ class Cleaner(SharedOcfObject):
|
||||
|
||||
@classmethod
|
||||
def get_ops(cls):
|
||||
return CleanerOps(init=cls._init, stop=cls._stop)
|
||||
return CleanerOps(init=cls._init, kick=cls._kick, stop=cls._stop)
|
||||
|
||||
@staticmethod
|
||||
@CleanerOps.INIT
|
||||
def _init(cleaner):
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
@CleanerOps.KICK
|
||||
def _kick(cleaner):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
@CleanerOps.STOP
|
||||
def _stop(cleaner):
|
||||
|
||||
Reference in New Issue
Block a user