ocf_core_get_cache does not increment cache reference count, so
it shouldn't be paired with cache_put
Fixes#117
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
When core frome corepool is added to cache, it's old name is loaded and cores
in corepool cannot be referenced by name anyway so new name is not needed.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Instead of silently allowing for any core_id in order to set
core parameter for all cores in cache, check explicitly for
special value (OCF_CORE_ID_INVALID) which means that no core
has been selected.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Since OCF doesn't use core and cache ids anymore adapter has to track occupied
ids on its own. After loading cache, ids of all loaded cores should be marked as
occupied, otherwise adding new core without explicit specifying core id will
fail.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
If core id wasn't specified, function was returning error insted of setting
given param for all cores.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Unitl now pointer to local variable was passed to OCF and it's content could be
overwriten after leaving function responsible for preparing cache config.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
In case of error during cache stop exported object is not being restored after destroying.
This may result in bug in case of calling stop once more.
This commit fixes this issue - exported objects are restored.
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Due the changes in ocf error codes adapter misinterpreted information about no
preexisting metadata.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Functions and macros dependent on different kernel versions are now generated
before compilation basing on current kernel capabilities instead of hardcoding
them for specific kernels.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
struct ocf_mngt_core_config no longer contains this information,
so we need to pass it as separate argument.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
We should only proceed with deinitialization in case of cache
write error, not just any error.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This needs to be done in caller application context. As part of asynchronous
management API rework, volume_open callback was moved to kernel worker thread
context. To work around this, atomic parameters are now read before cache
attach/load/probe and provided to bottom volume via volume params.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>