diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 4fb06e77d..ffa5d3713 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -52,7 +52,7 @@ static void _fix_missing_defaults(struct lv_segment *cpool_seg) cpool_seg->policy_name); } - if (cpool_seg->cache_mode == CACHE_MODE_UNDEFINED) { + if (cpool_seg->cache_mode == CACHE_MODE_UNSELECTED) { cpool_seg->cache_mode = CACHE_MODE_WHEN_MISSING; log_verbose("Cache pool %s is missing cache mode, using %s.", display_lvname(cpool_seg->lv), @@ -169,7 +169,7 @@ static int _cache_pool_text_export(const struct lv_segment *seg, * but not worth to break backward compatibility, by shifting * content to cache segment */ - if (seg->cache_mode != CACHE_MODE_UNDEFINED) { + if (seg->cache_mode != CACHE_MODE_UNSELECTED) { if (!(cache_mode = get_cache_mode_name(seg))) return_0; outf(f, "cache_mode = \"%s\"", cache_mode); diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c index 5779f2d42..1e9312701 100644 --- a/lib/metadata/cache_manip.c +++ b/lib/metadata/cache_manip.c @@ -35,7 +35,7 @@ const char *display_cache_mode(const struct lv_segment *seg) seg = first_seg(seg->pool_lv); if (!seg_is_cache_pool(seg) || - (seg->cache_mode == CACHE_MODE_UNDEFINED)) + (seg->cache_mode == CACHE_MODE_UNSELECTED)) return ""; return get_cache_mode_name(seg); @@ -83,7 +83,7 @@ int cache_set_cache_mode(struct lv_segment *seg, cache_mode_t mode) if (seg_is_cache(seg)) seg = first_seg(seg->pool_lv); else if (seg_is_cache_pool(seg)) { - if (mode == CACHE_MODE_UNDEFINED) + if (mode == CACHE_MODE_UNSELECTED) return 1; /* Defaults only for cache */ } else { log_error(INTERNAL_ERROR "Cannot set cache mode for non cache volume %s.", @@ -91,12 +91,12 @@ int cache_set_cache_mode(struct lv_segment *seg, cache_mode_t mode) return 0; } - if (mode != CACHE_MODE_UNDEFINED) { + if (mode != CACHE_MODE_UNSELECTED) { seg->cache_mode = mode; return 1; } - if (seg->cache_mode != CACHE_MODE_UNDEFINED) + if (seg->cache_mode != CACHE_MODE_UNSELECTED) return 1; /* Default already set in cache pool */ /* Figure default settings from config/profiles */ diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 42ca82041..7f9bbfe55 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -288,7 +288,7 @@ typedef enum { } thin_discards_t; typedef enum { - CACHE_MODE_UNDEFINED = 0, + CACHE_MODE_UNSELECTED = 0, CACHE_MODE_WRITETHROUGH, CACHE_MODE_WRITEBACK, CACHE_MODE_PASSTHROUGH, diff --git a/tools/lvchange.c b/tools/lvchange.c index 8fae806cb..d0d67b37e 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -634,7 +634,7 @@ static int _lvchange_cache(struct cmd_context *cmd, struct logical_volume *lv) if (!get_cache_params(cmd, &mode, &name, &settings)) goto_out; - if ((mode != CACHE_MODE_UNDEFINED) && + if ((mode != CACHE_MODE_UNSELECTED) && (mode != pool_seg->cache_mode) && lv_is_cache(lv)) { if (!lv_cache_wait_for_clean(lv, &is_clean)) diff --git a/tools/toollib.c b/tools/toollib.c index c9461e5bd..4d746ea6b 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1358,7 +1358,7 @@ int get_cache_params(struct cmd_context *cmd, int ok = 0; if (cache_mode) - *cache_mode = (cache_mode_t) arg_uint_value(cmd, cachemode_ARG, CACHE_MODE_UNDEFINED); + *cache_mode = (cache_mode_t) arg_uint_value(cmd, cachemode_ARG, CACHE_MODE_UNSELECTED); if (name) *name = arg_str_value(cmd, cachepolicy_ARG, NULL);