summaryrefslogtreecommitdiffstats
path: root/common/state/backend_bucket_circular.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-23 16:30:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commitb5eeaea7c9591a5e7406bbdf5578d29d62149f38 (patch)
treeb8d492a4bac9559c1f24c7730f6a33d3587df9bc /common/state/backend_bucket_circular.c
parent6f6604c918f95fccce2e94966f7c9512b80fb27c (diff)
downloadbarebox-b5eeaea7c9591a5e7406bbdf5578d29d62149f38.tar.gz
barebox-b5eeaea7c9591a5e7406bbdf5578d29d62149f38.tar.xz
state: backend: Add some documentation
Write some sentences to make the concepts clearer. 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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index 53ee0c3f57..58fffd18e3 100644
--- a/common/state/backend_bucket_circular.c
+++ b/common/state/backend_bucket_circular.c
@@ -25,7 +25,21 @@
#include "state.h"
-
+/*
+ * The circular backend bucket code. The circular backend bucket is intended
+ * for mtd devices which need an erase operation.
+ *
+ * Erasing blocks is an operation that should be avoided. On NOR flashes erasing
+ * blocks is very time consuming and on NAND flashes each block only has a limited
+ * number of erase cycles allowed. For this reason we continuously write more data
+ * into each eraseblock and only erase it when no more free space is available.
+ * Don't confuse these multiple writes into a single eraseblock with buckets. A bucket
+ * is the whole eraseblock, we just happen to reuse the same bucket for storing
+ * new data.
+ *
+ * If your device is a mtd device, but does not have eraseblocks, like MRAMs, then
+ * the direct bucket is used instead.
+ */
struct state_backend_storage_bucket_circular {
struct state_backend_storage_bucket bucket;