mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-01 18:50:41 +03:00
cleanup: cache use const char policy
Policy should be const char pointer.
This commit is contained in:
parent
d58cc2c0fc
commit
e2ea3cd7ba
@ -290,7 +290,7 @@ int lv_cache_block_info(const struct logical_volume *lv,
|
||||
}
|
||||
int lv_cache_policy_info(const struct logical_volume *lv,
|
||||
char **policy_name, int *policy_argc,
|
||||
char ***policy_argv)
|
||||
const char *const **policy_argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -1055,8 +1055,8 @@ int lv_cache_block_info(struct logical_volume *lv,
|
||||
}
|
||||
|
||||
int lv_cache_policy_info(struct logical_volume *lv,
|
||||
char **policy_name, int *policy_argc,
|
||||
char ***policy_argv)
|
||||
const char **policy_name, int *policy_argc,
|
||||
const char ***policy_argv)
|
||||
{
|
||||
int i;
|
||||
struct lv_segment *cache_seg;
|
||||
|
@ -124,8 +124,8 @@ int lv_cache_block_info(struct logical_volume *lv,
|
||||
uint32_t *chunk_size, uint64_t *dirty_count,
|
||||
uint64_t *used_count, uint64_t *total_count);
|
||||
int lv_cache_policy_info(struct logical_volume *lv,
|
||||
char **policy_name, int *policy_argc,
|
||||
char ***policy_argv);
|
||||
const char **policy_name, int *policy_argc,
|
||||
const char ***policy_argv);
|
||||
int lv_thin_pool_percent(const struct logical_volume *lv, int metadata,
|
||||
percent_t *percent);
|
||||
int lv_thin_percent(const struct logical_volume *lv, int mapped,
|
||||
|
@ -110,7 +110,7 @@ static int _cache_pool_text_import(struct lv_segment *seg,
|
||||
if (str &&
|
||||
(!(argv_str = dm_pool_strdup(mem, str)) ||
|
||||
((int)seg->core_argc != dm_split_words(argv_str, seg->core_argc,
|
||||
0, seg->core_argv))))
|
||||
0, (char **) seg->core_argv))))
|
||||
return SEG_LOG_ERROR("core_argc and core_argv do"
|
||||
" not match in");
|
||||
}
|
||||
@ -149,7 +149,7 @@ static int _cache_pool_text_import(struct lv_segment *seg,
|
||||
(!(argv_str = dm_pool_strdup(mem, str)) ||
|
||||
((int)seg->policy_argc != dm_split_words(argv_str,
|
||||
seg->policy_argc,
|
||||
0, seg->policy_argv))))
|
||||
0, (char **) seg->policy_argv))))
|
||||
return SEG_LOG_ERROR("policy_argc and policy_argv do"
|
||||
" not match in");
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ static int _cleanup_orphan_lv(struct logical_volume *lv)
|
||||
int lv_cache_remove(struct logical_volume *cache_lv)
|
||||
{
|
||||
struct cmd_context *cmd = cache_lv->vg->cmd;
|
||||
char *policy_name;
|
||||
const char *policy_name;
|
||||
uint64_t dirty_blocks;
|
||||
struct lv_segment *cache_seg = first_seg(cache_lv);
|
||||
struct logical_volume *corigin_lv;
|
||||
@ -220,7 +220,7 @@ int lv_cache_remove(struct logical_volume *cache_lv)
|
||||
* Is there are clean way to free the memory for the name
|
||||
* and argv when changing the policy?
|
||||
*/
|
||||
cache_seg->policy_name = (char *)"cleaner";
|
||||
cache_seg->policy_name = "cleaner";
|
||||
cache_seg->policy_argc = 0;
|
||||
cache_seg->policy_argv = NULL;
|
||||
|
||||
|
@ -398,10 +398,10 @@ struct lv_segment {
|
||||
|
||||
uint32_t feature_flags; /* For cache */
|
||||
unsigned core_argc; /* For cache */
|
||||
char **core_argv; /* For cache */
|
||||
char *policy_name; /* For cache */
|
||||
const char **core_argv; /* For cache */
|
||||
const char *policy_name; /* For cache */
|
||||
unsigned policy_argc; /* For cache */
|
||||
char **policy_argv; /* For cache */
|
||||
const char **policy_argv; /* For cache */
|
||||
|
||||
struct logical_volume *replicator;/* For replicator-devs - link to replicator LV */
|
||||
struct logical_volume *rlog_lv; /* For replicators */
|
||||
|
@ -773,10 +773,10 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
|
||||
uint32_t chunk_size,
|
||||
uint32_t feature_flags, /* DM_CACHE_FEATURE_* */
|
||||
unsigned core_argc,
|
||||
char **core_argv,
|
||||
char *policy_name,
|
||||
const char *const *core_argv,
|
||||
const char *policy_name,
|
||||
unsigned policy_argc,
|
||||
char **policy_argv);
|
||||
const char *const *policy_argv);
|
||||
|
||||
/*
|
||||
* Replicator operation mode
|
||||
|
@ -173,10 +173,10 @@ struct load_segment {
|
||||
char *uuid; /* Clustered mirror log */
|
||||
|
||||
unsigned core_argc; /* Cache */
|
||||
char **core_argv; /* Cache */
|
||||
char *policy_name; /* Cache */
|
||||
const char *const *core_argv; /* Cache */
|
||||
const char *policy_name; /* Cache */
|
||||
unsigned policy_argc; /* Cache */
|
||||
char **policy_argv; /* Cache */
|
||||
const char *const *policy_argv; /* Cache */
|
||||
|
||||
const char *cipher; /* Crypt */
|
||||
const char *chainmode; /* Crypt */
|
||||
@ -3227,10 +3227,10 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
|
||||
uint32_t chunk_size,
|
||||
uint32_t feature_flags, /* DM_CACHE_FEATURE_* */
|
||||
unsigned core_argc,
|
||||
char **core_argv,
|
||||
char *policy_name,
|
||||
const char *const *core_argv,
|
||||
const char *policy_name,
|
||||
unsigned policy_argc,
|
||||
char **policy_argv)
|
||||
const char *const *policy_argv)
|
||||
{
|
||||
int i;
|
||||
struct load_segment *seg = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user