diff --git a/modules/cas_cache/service_ui_ioctl.c b/modules/cas_cache/service_ui_ioctl.c index f91d240..2fc0246 100644 --- a/modules/cas_cache/service_ui_ioctl.c +++ b/modules/cas_cache/service_ui_ioctl.c @@ -132,6 +132,16 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd, RETURN_CMD_RESULT(cmd_info, arg, retval); } + case KCAS_IOCTL_REMOVE_INACTIVE: { + struct kcas_remove_inactive *cmd_info; + + GET_CMD_INFO(cmd_info, arg); + + retval = cache_mngt_remove_inactive_core(cmd_info); + + RETURN_CMD_RESULT(cmd_info, arg, retval); + } + case KCAS_IOCTL_RESET_STATS: { struct kcas_reset_stats *cmd_info; char cache_name[OCF_CACHE_NAME_SIZE]; diff --git a/modules/include/cas_ioctl_codes.h b/modules/include/cas_ioctl_codes.h index 4b98ceb..4ef1358 100644 --- a/modules/include/cas_ioctl_codes.h +++ b/modules/include/cas_ioctl_codes.h @@ -123,6 +123,13 @@ struct kcas_remove_core { int ext_err_code; }; +struct kcas_remove_inactive { + uint16_t cache_id; /**< id of an running cache */ + uint16_t core_id; /**< id core object to be removed */ + + int ext_err_code; +}; + struct kcas_reset_stats { uint16_t cache_id; /**< id of an running cache */ uint16_t core_id; /**< id core object to be removed */ @@ -419,6 +426,7 @@ struct kcas_get_cache_param { * 34 * KCAS_IOCTL_GET_STATS * OK * * 35 * KCAS_IOCTL_PURGE_CACHE * OK * * 36 * KCAS_IOCTL_PURGE_CORE * OK * + * 37 * KCAS_IOCTL_REMOVE_INACTIVE * OK * ******************************************************************************* */ @@ -517,6 +525,9 @@ struct kcas_get_cache_param { * and invalidate all valid cache lines associated with given core. */ #define KCAS_IOCTL_PURGE_CORE _IOWR(KCAS_IOCTL_MAGIC, 36, struct kcas_flush_core) +/** Remove inactive core object from an running cache instance */ +#define KCAS_IOCTL_REMOVE_INACTIVE _IOR(KCAS_IOCTL_MAGIC, 37, struct kcas_remove_inactive) + /** * Extended kernel CAS error codes */