summaryrefslogtreecommitdiffstats
path: root/common/state/state.h
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/state.h
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/state.h')
-rw-r--r--common/state/state.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/common/state/state.h b/common/state/state.h
index 4ef46693c6..6f5de31dff 100644
--- a/common/state/state.h
+++ b/common/state/state.h
@@ -20,14 +20,12 @@ struct mtd_info_user;
* @bucket_list A list element struct to attach this bucket to a list
*/
struct state_backend_storage_bucket {
- int (*init) (struct state_backend_storage_bucket * bucket);
int (*write) (struct state_backend_storage_bucket * bucket,
const uint8_t * buf, ssize_t len);
int (*read) (struct state_backend_storage_bucket * bucket,
uint8_t ** buf, ssize_t * len_hint);
void (*free) (struct state_backend_storage_bucket * bucket);
- bool initialized;
struct list_head bucket_list;
};
@@ -196,8 +194,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);
int state_backend_bucket_cached_create(struct device_d *dev,
struct state_backend_storage_bucket *raw,
struct state_backend_storage_bucket **out);