summaryrefslogtreecommitdiffstats
path: root/common/state/backend_bucket_circular.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-22 16:16:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commitad1d6953590fdcf350dd3c9eda4fd551a1f9dac3 (patch)
tree462fe11fc499c858d6c17908f5788ce5fb881aa0 /common/state/backend_bucket_circular.c
parent7599f6e56a2480df2831a47de4d62687b57c5249 (diff)
downloadbarebox-ad1d6953590fdcf350dd3c9eda4fd551a1f9dac3.tar.gz
barebox-ad1d6953590fdcf350dd3c9eda4fd551a1f9dac3.tar.xz
state: drop lazy_init
lazy_init is an optimization that makes it possible to read only up to the first valid bucket when starting. However, when restoring consistency, immediately afterwards we have we have to initialize all buckets anyway, so being lazy doesn't give us any gain. Remove it to simplify the code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/state/backend_bucket_circular.c')
-rw-r--r--common/state/backend_bucket_circular.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index 53c2aae803..8eae86694a 100644
--- a/common/state/backend_bucket_circular.c
+++ b/common/state/backend_bucket_circular.c
@@ -456,8 +456,7 @@ int state_backend_bucket_circular_create(struct device_d *dev, const char *path,
struct state_backend_storage_bucket **bucket,
unsigned int eraseblock,
ssize_t writesize,
- struct mtd_info_user *mtd_uinfo,
- bool lazy_init)
+ struct mtd_info_user *mtd_uinfo)
{
struct state_backend_storage_bucket_circular *circ;
int ret;
@@ -493,13 +492,9 @@ int state_backend_bucket_circular_create(struct device_d *dev, const char *path,
circ->bucket.free = state_backend_bucket_circular_free;
*bucket = &circ->bucket;
- if (!lazy_init) {
- ret = state_backend_bucket_circular_init(*bucket);
- if (ret)
- goto out_free;
- } else {
- circ->bucket.init = state_backend_bucket_circular_init;
- }
+ ret = state_backend_bucket_circular_init(*bucket);
+ if (ret)
+ goto out_free;
return 0;