diff options
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-spine.c')
-rw-r--r-- | drivers/md/persistent-data/dm-btree-spine.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c index e653458888a7..7540383b7cf3 100644 --- a/drivers/md/persistent-data/dm-btree-spine.c +++ b/drivers/md/persistent-data/dm-btree-spine.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2011 Red Hat, Inc. * @@ -39,7 +40,7 @@ static int node_check(struct dm_block_validator *v, uint32_t flags, nr_entries, max_entries; if (dm_block_location(b) != le64_to_cpu(h->blocknr)) { - DMERR_LIMIT("node_check failed: blocknr %llu != wanted %llu", + DMERR_LIMIT("%s failed: blocknr %llu != wanted %llu", __func__, le64_to_cpu(h->blocknr), dm_block_location(b)); return -ENOTBLK; } @@ -48,7 +49,7 @@ static int node_check(struct dm_block_validator *v, block_size - sizeof(__le32), BTREE_CSUM_XOR)); if (csum_disk != h->csum) { - DMERR_LIMIT("node_check failed: csum %u != wanted %u", + DMERR_LIMIT("%s failed: csum %u != wanted %u", __func__, le32_to_cpu(csum_disk), le32_to_cpu(h->csum)); return -EILSEQ; } @@ -59,12 +60,12 @@ static int node_check(struct dm_block_validator *v, if (sizeof(struct node_header) + (sizeof(__le64) + value_size) * max_entries > block_size) { - DMERR_LIMIT("node_check failed: max_entries too large"); + DMERR_LIMIT("%s failed: max_entries too large", __func__); return -EILSEQ; } if (nr_entries > max_entries) { - DMERR_LIMIT("node_check failed: too many entries"); + DMERR_LIMIT("%s failed: too many entries", __func__); return -EILSEQ; } @@ -73,7 +74,7 @@ static int node_check(struct dm_block_validator *v, */ flags = le32_to_cpu(h->flags); if (!(flags & INTERNAL_NODE) && !(flags & LEAF_NODE)) { - DMERR_LIMIT("node_check failed: node is neither INTERNAL or LEAF"); + DMERR_LIMIT("%s failed: node is neither INTERNAL or LEAF", __func__); return -EILSEQ; } @@ -132,9 +133,8 @@ void exit_ro_spine(struct ro_spine *s) { int i; - for (i = 0; i < s->count; i++) { + for (i = 0; i < s->count; i++) unlock_block(s->info, s->nodes[i]); - } } int ro_step(struct ro_spine *s, dm_block_t new_child) @@ -183,9 +183,8 @@ void exit_shadow_spine(struct shadow_spine *s) { int i; - for (i = 0; i < s->count; i++) { + for (i = 0; i < s->count; i++) unlock_block(s->info, s->nodes[i]); - } } int shadow_step(struct shadow_spine *s, dm_block_t b, @@ -234,12 +233,12 @@ dm_block_t shadow_root(struct shadow_spine *s) return s->root; } -static void le64_inc(void *context, const void *value_le, unsigned count) +static void le64_inc(void *context, const void *value_le, unsigned int count) { dm_tm_with_runs(context, value_le, count, dm_tm_inc_range); } -static void le64_dec(void *context, const void *value_le, unsigned count) +static void le64_dec(void *context, const void *value_le, unsigned int count) { dm_tm_with_runs(context, value_le, count, dm_tm_dec_range); } |