diff --git a/casadm/cas_main.c b/casadm/cas_main.c index 208ec3d..d7278cb 100644 --- a/casadm/cas_main.c +++ b/casadm/cas_main.c @@ -744,8 +744,9 @@ static cli_namespace set_param_namespace = { int set_param_seq_cutoff_handle_option(char *opt, const char **arg) { if (!strcmp(opt, "threshold")) { - if (validate_str_num(arg[0], "sequential cutoff threshold", 1, - 4194181) == FAILURE) + if (validate_str_num(arg[0], "sequential cutoff threshold", + OCF_SEQ_CUTOFF_MIN_THRESHOLD, + OCF_SEQ_CUTOFF_MAX_THRESHOLD) == FAILURE) return FAILURE; SET_CORE_PARAM(core_param_seq_cutoff_threshold, atoi(arg[0]) * KiB); @@ -764,8 +765,9 @@ int set_param_seq_cutoff_handle_option(char *opt, const char **arg) return FAILURE; } } else if (!strcmp(opt, "promotion-count")) { - if (validate_str_num(arg[0], "sequential cutoff promotion request count", 1, - 65535) == FAILURE) + if (validate_str_num(arg[0], "sequential cutoff promotion request count", + OCF_SEQ_CUTOFF_MIN_PROMOTION_COUNT, + OCF_SEQ_CUTOFF_MAX_PROMOTION_COUNT) == FAILURE) return FAILURE; SET_CORE_PARAM(core_param_seq_cutoff_promotion_count, atoi(arg[0])); diff --git a/casadm/extended_err_msg.c b/casadm/extended_err_msg.c index dd8b1c9..7fecbc1 100644 --- a/casadm/extended_err_msg.c +++ b/casadm/extended_err_msg.c @@ -158,6 +158,10 @@ struct { OCF_ERR_INVAL_CACHE_DEV, "Device does not meet requirements." }, + { + OCF_ERR_NO_LOCK, + "Failed to lock cache for management operation." + }, /* CAS kernel error mappings*/ { @@ -253,11 +257,6 @@ struct { "Waiting for operation interrupted" }, { - KCAS_ERR_CACHE_STOPPING, - "Cache being stopped" - }, - { - KCAS_ERR_CORE_IN_ACTIVE_STATE, "Core device is in active state" }, diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 9f0ad9d..1f12432 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -98,13 +98,6 @@ static int _cache_mngt_lock_sync(ocf_cache_t cache) struct _cache_mngt_async_context *context; int result; - if (!ocf_cache_is_running(cache)) { - printk(KERN_WARNING "%s is being stopped. " - "Can't perform management operations\n", - ocf_cache_get_name(cache)); - return -KCAS_ERR_CACHE_STOPPING; - } - context = kmalloc(sizeof(*context), GFP_KERNEL); if (!context) return -ENOMEM; @@ -142,13 +135,6 @@ static int _cache_mngt_read_lock_sync(ocf_cache_t cache) struct _cache_mngt_async_context *context; int result; - if (!ocf_cache_is_running(cache)) { - printk(KERN_WARNING "%s is being stopped. " - "Can't perform management operations\n", - ocf_cache_get_name(cache)); - return -KCAS_ERR_CACHE_STOPPING; - } - context = kmalloc(sizeof(*context), GFP_KERNEL); if (!context) return -ENOMEM; @@ -2432,7 +2418,6 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush) case -OCF_ERR_CACHE_IN_INCOMPLETE_STATE: case -OCF_ERR_FLUSHING_INTERRUPTED: case -KCAS_ERR_WAITING_INTERRUPTED: - case -KCAS_ERR_CACHE_STOPPING: goto put; default: flush_status = status; diff --git a/modules/include/cas_ioctl_codes.h b/modules/include/cas_ioctl_codes.h index 4ef1358..37d6bc0 100644 --- a/modules/include/cas_ioctl_codes.h +++ b/modules/include/cas_ioctl_codes.h @@ -526,7 +526,7 @@ struct kcas_get_cache_param { #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) +#define KCAS_IOCTL_REMOVE_INACTIVE _IOWR(KCAS_IOCTL_MAGIC, 37, struct kcas_remove_inactive) /** * Extended kernel CAS error codes @@ -598,9 +598,6 @@ enum kcas_error { /** Waiting for async operation was interrupted */ KCAS_ERR_WAITING_INTERRUPTED, - /** Cache already being stopped*/ - KCAS_ERR_CACHE_STOPPING, - /** Core device is in active state */ KCAS_ERR_CORE_IN_ACTIVE_STATE };