diff options
Diffstat (limited to 'lib/filters')
-rw-r--r-- | lib/filters/filter-persistent.c | 20 | ||||
-rw-r--r-- | lib/filters/filter-persistent.h | 2 | ||||
-rw-r--r-- | lib/filters/filter-regex.c | 8 | ||||
-rw-r--r-- | lib/filters/filter-regex.h | 2 | ||||
-rw-r--r-- | lib/filters/filter.c | 10 | ||||
-rw-r--r-- | lib/filters/filter.h | 2 |
6 files changed, 22 insertions, 22 deletions
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c index 8570bac9..52f3758c 100644 --- a/lib/filters/filter-persistent.c +++ b/lib/filters/filter-persistent.c @@ -64,13 +64,13 @@ int persistent_filter_wipe(struct dev_filter *f) return 1; } -static int _read_array(struct pfilter *pf, struct config_tree *cft, +static int _read_array(struct pfilter *pf, struct dm_config_tree *cft, const char *path, void *data) { - const struct config_node *cn; - const struct config_value *cv; + const struct dm_config_node *cn; + const struct dm_config_value *cv; - if (!(cn = find_config_node(cft->root, path))) { + if (!(cn = dm_config_find_node(cft->root, path))) { log_very_verbose("Couldn't find %s array in '%s'", path, pf->file); return 0; @@ -81,7 +81,7 @@ static int _read_array(struct pfilter *pf, struct config_tree *cft, * devices as we go. */ for (cv = cn->v; cv; cv = cv->next) { - if (cv->type != CFG_STRING) { + if (cv->type != DM_CFG_STRING) { log_verbose("Devices array contains a value " "which is not a string ... ignoring"); continue; @@ -96,10 +96,10 @@ static int _read_array(struct pfilter *pf, struct config_tree *cft, return 1; } -int persistent_filter_load(struct dev_filter *f, struct config_tree **cft_out) +int persistent_filter_load(struct dev_filter *f, struct dm_config_tree **cft_out) { struct pfilter *pf = (struct pfilter *) f->private; - struct config_tree *cft; + struct dm_config_tree *cft; struct stat info; int r = 0; @@ -122,7 +122,7 @@ int persistent_filter_load(struct dev_filter *f, struct config_tree **cft_out) return_0; } - if (!(cft = create_config_tree(pf->file, 1))) + if (!(cft = dm_config_create(pf->file, 1))) return_0; if (!read_config_file(cft)) @@ -173,7 +173,7 @@ static void _write_array(struct pfilter *pf, FILE *fp, const char *path, first = 0; } - escape_double_quotes(buf, dm_hash_get_key(pf->devices, n)); + dm_escape_double_quotes(buf, dm_hash_get_key(pf->devices, n)); fprintf(fp, "\t\t\"%s\"", buf); } @@ -186,7 +186,7 @@ int persistent_filter_dump(struct dev_filter *f, int merge_existing) struct pfilter *pf; char *tmp_file; struct stat info, info2; - struct config_tree *cft = NULL; + struct dm_config_tree *cft = NULL; FILE *fp; int lockfd; int r = 0; diff --git a/lib/filters/filter-persistent.h b/lib/filters/filter-persistent.h index a7f1245e..ad56a62b 100644 --- a/lib/filters/filter-persistent.h +++ b/lib/filters/filter-persistent.h @@ -22,7 +22,7 @@ struct dev_filter *persistent_filter_create(struct dev_filter *f, const char *file); int persistent_filter_wipe(struct dev_filter *f); -int persistent_filter_load(struct dev_filter *f, struct config_tree **cft_out); +int persistent_filter_load(struct dev_filter *f, struct dm_config_tree **cft_out); int persistent_filter_dump(struct dev_filter *f, int merge_existing); #endif diff --git a/lib/filters/filter-regex.c b/lib/filters/filter-regex.c index fc83469d..1b460312 100644 --- a/lib/filters/filter-regex.c +++ b/lib/filters/filter-regex.c @@ -87,10 +87,10 @@ static int _extract_pattern(struct dm_pool *mem, const char *pat, return 1; } -static int _build_matcher(struct rfilter *rf, const struct config_value *val) +static int _build_matcher(struct rfilter *rf, const struct dm_config_value *val) { struct dm_pool *scratch; - const struct config_value *v; + const struct dm_config_value *v; char **regex; unsigned count = 0; int i, r = 0; @@ -102,7 +102,7 @@ static int _build_matcher(struct rfilter *rf, const struct config_value *val) * count how many patterns we have. */ for (v = val; v; v = v->next) { - if (v->type != CFG_STRING) { + if (v->type != DM_CFG_STRING) { log_error("Filter patterns must be enclosed in quotes."); goto out; } @@ -188,7 +188,7 @@ static void _regex_destroy(struct dev_filter *f) dm_pool_destroy(rf->mem); } -struct dev_filter *regex_filter_create(const struct config_value *patterns) +struct dev_filter *regex_filter_create(const struct dm_config_value *patterns) { struct dm_pool *mem = dm_pool_create("filter regex", 10 * 1024); struct rfilter *rf; diff --git a/lib/filters/filter-regex.h b/lib/filters/filter-regex.h index a009c911..bb71f56f 100644 --- a/lib/filters/filter-regex.h +++ b/lib/filters/filter-regex.h @@ -27,6 +27,6 @@ * r|.*| - reject everything else */ -struct dev_filter *regex_filter_create(const struct config_value *patterns); +struct dev_filter *regex_filter_create(const struct dm_config_value *patterns); #endif diff --git a/lib/filters/filter.c b/lib/filters/filter.c index a9b99a53..f2398a1f 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -177,7 +177,7 @@ static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute__((un return ret; } -static int _scan_proc_dev(const char *proc, const struct config_node *cn) +static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn) { char line[80]; char proc_devices[PATH_MAX]; @@ -186,7 +186,7 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) int line_maj = 0; int blocksection = 0; size_t dev_len = 0; - const struct config_value *cv; + const struct dm_config_value *cv; const char *name; @@ -269,7 +269,7 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) /* Check devices/types for local variations */ for (cv = cn->v; cv; cv = cv->next) { - if (cv->type != CFG_STRING) { + if (cv->type != DM_CFG_STRING) { log_error("Expecting string in devices/types " "in config file"); if (fclose(pd)) @@ -279,7 +279,7 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) dev_len = strlen(cv->v.str); name = cv->v.str; cv = cv->next; - if (!cv || cv->type != CFG_INT) { + if (!cv || cv->type != DM_CFG_INT) { log_error("Max partition count missing for %s " "in devices/types in config file", name); @@ -316,7 +316,7 @@ int max_partitions(int major) } struct dev_filter *lvm_type_filter_create(const char *proc, - const struct config_node *cn) + const struct dm_config_node *cn) { struct dev_filter *f; diff --git a/lib/filters/filter.h b/lib/filters/filter.h index 07611f9e..5c6047a4 100644 --- a/lib/filters/filter.h +++ b/lib/filters/filter.h @@ -31,7 +31,7 @@ #endif struct dev_filter *lvm_type_filter_create(const char *proc, - const struct config_node *cn); + const struct dm_config_node *cn); void lvm_type_filter_destroy(struct dev_filter *f); |