Merge pull request #727 from mmichal10/seq-cutoff-consts
Seq cutoff consts
This commit is contained in:
commit
4a0fba8e79
@ -744,8 +744,9 @@ static cli_namespace set_param_namespace = {
|
|||||||
int set_param_seq_cutoff_handle_option(char *opt, const char **arg)
|
int set_param_seq_cutoff_handle_option(char *opt, const char **arg)
|
||||||
{
|
{
|
||||||
if (!strcmp(opt, "threshold")) {
|
if (!strcmp(opt, "threshold")) {
|
||||||
if (validate_str_num(arg[0], "sequential cutoff threshold", 1,
|
if (validate_str_num(arg[0], "sequential cutoff threshold",
|
||||||
4194181) == FAILURE)
|
OCF_SEQ_CUTOFF_MIN_THRESHOLD,
|
||||||
|
OCF_SEQ_CUTOFF_MAX_THRESHOLD) == FAILURE)
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
|
||||||
SET_CORE_PARAM(core_param_seq_cutoff_threshold, atoi(arg[0]) * KiB);
|
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;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
} else if (!strcmp(opt, "promotion-count")) {
|
} else if (!strcmp(opt, "promotion-count")) {
|
||||||
if (validate_str_num(arg[0], "sequential cutoff promotion request count", 1,
|
if (validate_str_num(arg[0], "sequential cutoff promotion request count",
|
||||||
65535) == FAILURE)
|
OCF_SEQ_CUTOFF_MIN_PROMOTION_COUNT,
|
||||||
|
OCF_SEQ_CUTOFF_MAX_PROMOTION_COUNT) == FAILURE)
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
|
||||||
SET_CORE_PARAM(core_param_seq_cutoff_promotion_count, atoi(arg[0]));
|
SET_CORE_PARAM(core_param_seq_cutoff_promotion_count, atoi(arg[0]));
|
||||||
|
@ -158,6 +158,10 @@ struct {
|
|||||||
OCF_ERR_INVAL_CACHE_DEV,
|
OCF_ERR_INVAL_CACHE_DEV,
|
||||||
"Device does not meet requirements."
|
"Device does not meet requirements."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
OCF_ERR_NO_LOCK,
|
||||||
|
"Failed to lock cache for management operation."
|
||||||
|
},
|
||||||
|
|
||||||
/* CAS kernel error mappings*/
|
/* CAS kernel error mappings*/
|
||||||
{
|
{
|
||||||
@ -253,11 +257,6 @@ struct {
|
|||||||
"Waiting for operation interrupted"
|
"Waiting for operation interrupted"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
KCAS_ERR_CACHE_STOPPING,
|
|
||||||
"Cache being stopped"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
|
|
||||||
KCAS_ERR_CORE_IN_ACTIVE_STATE,
|
KCAS_ERR_CORE_IN_ACTIVE_STATE,
|
||||||
"Core device is in active state"
|
"Core device is in active state"
|
||||||
},
|
},
|
||||||
|
@ -98,13 +98,6 @@ static int _cache_mngt_lock_sync(ocf_cache_t cache)
|
|||||||
struct _cache_mngt_async_context *context;
|
struct _cache_mngt_async_context *context;
|
||||||
int result;
|
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);
|
context = kmalloc(sizeof(*context), GFP_KERNEL);
|
||||||
if (!context)
|
if (!context)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -142,13 +135,6 @@ static int _cache_mngt_read_lock_sync(ocf_cache_t cache)
|
|||||||
struct _cache_mngt_async_context *context;
|
struct _cache_mngt_async_context *context;
|
||||||
int result;
|
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);
|
context = kmalloc(sizeof(*context), GFP_KERNEL);
|
||||||
if (!context)
|
if (!context)
|
||||||
return -ENOMEM;
|
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_CACHE_IN_INCOMPLETE_STATE:
|
||||||
case -OCF_ERR_FLUSHING_INTERRUPTED:
|
case -OCF_ERR_FLUSHING_INTERRUPTED:
|
||||||
case -KCAS_ERR_WAITING_INTERRUPTED:
|
case -KCAS_ERR_WAITING_INTERRUPTED:
|
||||||
case -KCAS_ERR_CACHE_STOPPING:
|
|
||||||
goto put;
|
goto put;
|
||||||
default:
|
default:
|
||||||
flush_status = status;
|
flush_status = status;
|
||||||
|
@ -526,7 +526,7 @@ struct kcas_get_cache_param {
|
|||||||
#define KCAS_IOCTL_PURGE_CORE _IOWR(KCAS_IOCTL_MAGIC, 36, struct kcas_flush_core)
|
#define KCAS_IOCTL_PURGE_CORE _IOWR(KCAS_IOCTL_MAGIC, 36, struct kcas_flush_core)
|
||||||
|
|
||||||
/** Remove inactive core object from an running cache instance */
|
/** 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
|
* Extended kernel CAS error codes
|
||||||
@ -598,9 +598,6 @@ enum kcas_error {
|
|||||||
/** Waiting for async operation was interrupted */
|
/** Waiting for async operation was interrupted */
|
||||||
KCAS_ERR_WAITING_INTERRUPTED,
|
KCAS_ERR_WAITING_INTERRUPTED,
|
||||||
|
|
||||||
/** Cache already being stopped*/
|
|
||||||
KCAS_ERR_CACHE_STOPPING,
|
|
||||||
|
|
||||||
/** Core device is in active state */
|
/** Core device is in active state */
|
||||||
KCAS_ERR_CORE_IN_ACTIVE_STATE
|
KCAS_ERR_CORE_IN_ACTIVE_STATE
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user