summaryrefslogtreecommitdiffstats
path: root/common/state
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-24 10:30:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commit73f3dae29a761034459a41f6300dcf4665f78af5 (patch)
treee99006c496f2c33634fb567adaaf0fde8ada7e43 /common/state
parent75e8aac036d9abefac7d0e1d3d4c1456f1cba134 (diff)
downloadbarebox-73f3dae29a761034459a41f6300dcf4665f78af5.tar.gz
barebox-73f3dae29a761034459a41f6300dcf4665f78af5.tar.xz
state: backend_storage: rename more variables
Use "buckets" rather than "copies" in variable names. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/state')
-rw-r--r--common/state/backend_storage.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 8d0f285f77..a5688aa424 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -47,7 +47,7 @@
* when storing a new state we can just write all buckets in order.
*/
-static const unsigned int min_copies_written = 1;
+static const unsigned int min_buckets_written = 1;
/**
* state_storage_write - Writes the given data to the storage
@@ -60,7 +60,7 @@ static const unsigned int min_copies_written = 1;
* operation on all of them. Writes are always in the same sequence. This
* ensures, that reading in the same sequence will always return the latest
* written valid data first.
- * We try to at least write min_copies_written. If this fails we return with an
+ * We try to at least write min_buckets_written. If this fails we return with an
* error.
*/
int state_storage_write(struct state_backend_storage *storage,
@@ -68,7 +68,7 @@ int state_storage_write(struct state_backend_storage *storage,
{
struct state_backend_storage_bucket *bucket;
int ret;
- int copies_written = 0;
+ int buckets_written = 0;
if (storage->readonly)
return 0;
@@ -79,15 +79,15 @@ int state_storage_write(struct state_backend_storage *storage,
dev_warn(storage->dev, "Failed to write state backend bucket, %d\n",
ret);
} else {
- ++copies_written;
+ ++buckets_written;
}
}
- if (copies_written >= min_copies_written)
+ if (buckets_written >= min_buckets_written)
return 0;
dev_err(storage->dev, "Failed to write state to at least %d buckets. Successfully written to %d buckets\n",
- min_copies_written, copies_written);
+ min_buckets_written, buckets_written);
return -EIO;
}