diff options
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-spine.c')
-rw-r--r-- | drivers/md/persistent-data/dm-btree-spine.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c index d9a7912ee8ee..f199a0c4ed04 100644 --- a/drivers/md/persistent-data/dm-btree-spine.c +++ b/drivers/md/persistent-data/dm-btree-spine.c | |||
@@ -23,7 +23,7 @@ static void node_prepare_for_write(struct dm_block_validator *v, | |||
23 | struct dm_block *b, | 23 | struct dm_block *b, |
24 | size_t block_size) | 24 | size_t block_size) |
25 | { | 25 | { |
26 | struct node *n = dm_block_data(b); | 26 | struct btree_node *n = dm_block_data(b); |
27 | struct node_header *h = &n->header; | 27 | struct node_header *h = &n->header; |
28 | 28 | ||
29 | h->blocknr = cpu_to_le64(dm_block_location(b)); | 29 | h->blocknr = cpu_to_le64(dm_block_location(b)); |
@@ -38,15 +38,15 @@ static int node_check(struct dm_block_validator *v, | |||
38 | struct dm_block *b, | 38 | struct dm_block *b, |
39 | size_t block_size) | 39 | size_t block_size) |
40 | { | 40 | { |
41 | struct node *n = dm_block_data(b); | 41 | struct btree_node *n = dm_block_data(b); |
42 | struct node_header *h = &n->header; | 42 | struct node_header *h = &n->header; |
43 | size_t value_size; | 43 | size_t value_size; |
44 | __le32 csum_disk; | 44 | __le32 csum_disk; |
45 | uint32_t flags; | 45 | uint32_t flags; |
46 | 46 | ||
47 | if (dm_block_location(b) != le64_to_cpu(h->blocknr)) { | 47 | if (dm_block_location(b) != le64_to_cpu(h->blocknr)) { |
48 | DMERR("node_check failed blocknr %llu wanted %llu", | 48 | DMERR_LIMIT("node_check failed: blocknr %llu != wanted %llu", |
49 | le64_to_cpu(h->blocknr), dm_block_location(b)); | 49 | le64_to_cpu(h->blocknr), dm_block_location(b)); |
50 | return -ENOTBLK; | 50 | return -ENOTBLK; |
51 | } | 51 | } |
52 | 52 | ||
@@ -54,8 +54,8 @@ static int node_check(struct dm_block_validator *v, | |||
54 | block_size - sizeof(__le32), | 54 | block_size - sizeof(__le32), |
55 | BTREE_CSUM_XOR)); | 55 | BTREE_CSUM_XOR)); |
56 | if (csum_disk != h->csum) { | 56 | if (csum_disk != h->csum) { |
57 | DMERR("node_check failed csum %u wanted %u", | 57 | DMERR_LIMIT("node_check failed: csum %u != wanted %u", |
58 | le32_to_cpu(csum_disk), le32_to_cpu(h->csum)); | 58 | le32_to_cpu(csum_disk), le32_to_cpu(h->csum)); |
59 | return -EILSEQ; | 59 | return -EILSEQ; |
60 | } | 60 | } |
61 | 61 | ||
@@ -63,12 +63,12 @@ static int node_check(struct dm_block_validator *v, | |||
63 | 63 | ||
64 | if (sizeof(struct node_header) + | 64 | if (sizeof(struct node_header) + |
65 | (sizeof(__le64) + value_size) * le32_to_cpu(h->max_entries) > block_size) { | 65 | (sizeof(__le64) + value_size) * le32_to_cpu(h->max_entries) > block_size) { |
66 | DMERR("node_check failed: max_entries too large"); | 66 | DMERR_LIMIT("node_check failed: max_entries too large"); |
67 | return -EILSEQ; | 67 | return -EILSEQ; |
68 | } | 68 | } |
69 | 69 | ||
70 | if (le32_to_cpu(h->nr_entries) > le32_to_cpu(h->max_entries)) { | 70 | if (le32_to_cpu(h->nr_entries) > le32_to_cpu(h->max_entries)) { |
71 | DMERR("node_check failed, too many entries"); | 71 | DMERR_LIMIT("node_check failed: too many entries"); |
72 | return -EILSEQ; | 72 | return -EILSEQ; |
73 | } | 73 | } |
74 | 74 | ||
@@ -77,7 +77,7 @@ static int node_check(struct dm_block_validator *v, | |||
77 | */ | 77 | */ |
78 | flags = le32_to_cpu(h->flags); | 78 | flags = le32_to_cpu(h->flags); |
79 | if (!(flags & INTERNAL_NODE) && !(flags & LEAF_NODE)) { | 79 | if (!(flags & INTERNAL_NODE) && !(flags & LEAF_NODE)) { |
80 | DMERR("node_check failed, node is neither INTERNAL or LEAF"); | 80 | DMERR_LIMIT("node_check failed: node is neither INTERNAL or LEAF"); |
81 | return -EILSEQ; | 81 | return -EILSEQ; |
82 | } | 82 | } |
83 | 83 | ||
@@ -164,7 +164,7 @@ int ro_step(struct ro_spine *s, dm_block_t new_child) | |||
164 | return r; | 164 | return r; |
165 | } | 165 | } |
166 | 166 | ||
167 | struct node *ro_node(struct ro_spine *s) | 167 | struct btree_node *ro_node(struct ro_spine *s) |
168 | { | 168 | { |
169 | struct dm_block *block; | 169 | struct dm_block *block; |
170 | 170 | ||