From 1f386378a7b8173220648afeab41605ac7742364 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 24 Mar 2017 08:15:52 +0100 Subject: state: backend_circular: default to circular storage Default to the new circular storage format which saves erase cycles. The old format can still be selected with backend-storage-type = "noncircular". Signed-off-by: Sascha Hauer --- common/state/backend_storage.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'common/state/backend_storage.c') diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c index f9e8151670..036204c188 100644 --- a/common/state/backend_storage.c +++ b/common/state/backend_storage.c @@ -376,13 +376,15 @@ int state_storage_init(struct state *state, const char *path, ret = mtd_get_meminfo(path, &meminfo); if (!ret && !(meminfo.flags & MTD_NO_ERASE)) { - bool circular = true; - if (!storagetype) { - circular = false; - } else if (strcmp(storagetype, "circular")) { - dev_warn(storage->dev, "Unknown storagetype '%s', falling back to old format circular storage type.\n", - storagetype); + bool circular; + if (!storagetype || !strcmp(storagetype, "circular")) { + circular = true; + } else if (!strcmp(storagetype, "noncircular")) { + dev_warn(storage->dev, "using old format circular storage type.\n"); circular = false; + } else { + dev_warn(storage->dev, "unknown storage type '%s'\n", storagetype); + return -EINVAL; } return state_storage_mtd_buckets_init(storage, &meminfo, circular); } else { -- cgit v1.2.3