summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-24 08:56:48 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commitfcdda4abc4b11263d81773389949d80e4b3df930 (patch)
tree8366135d9543197b52e8ab1277d9ca86311e5b85
parent1f386378a7b8173220648afeab41605ac7742364 (diff)
downloadbarebox-fcdda4abc4b11263d81773389949d80e4b3df930.tar.gz
barebox-fcdda4abc4b11263d81773389949d80e4b3df930.tar.xz
state: backend_circular: rewrite function doc
The commment talks about copies where buckets are meant and also claims we start at offset 0, which may not be true. Rewrite comment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/state/backend_storage.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 036204c188..d29db36cca 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -226,11 +226,9 @@ const int desired_copies = 3;
* @param circular If false, use non-circular mode to write data that is compatible with the old on-flash format
* @return 0 on success, -errno otherwise
*
- * Starting from offset 0 this function tries to create circular buckets on
- * different offsets in the device. Different copies of the data are located in
- * different eraseblocks.
- * For MTD devices we use circular buckets to minimize the number of erases.
- * Circular buckets write new data always in the next free space.
+ * This function iterates over the eraseblocks and creates one bucket on
+ * each eraseblock until we have the number of desired buckets. Bad blocks
+ * will be skipped and the next block will be used.
*/
static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
struct mtd_info_user *meminfo, bool circular)