mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
dm persistent data: rename node to btree_node
This patch fixes a compilation failure on sparc32 by renaming struct node. struct node is already defined in include/linux/node.h. On sparc32, it happens to be included through other dependencies and persistent-data doesn't compile because of conflicting declarations. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
committed by
Alasdair G Kergon
parent
29594404d7
commit
550929faf8
@@ -53,7 +53,7 @@
|
||||
/*
|
||||
* Some little utilities for moving node data around.
|
||||
*/
|
||||
static void node_shift(struct node *n, int shift)
|
||||
static void node_shift(struct btree_node *n, int shift)
|
||||
{
|
||||
uint32_t nr_entries = le32_to_cpu(n->header.nr_entries);
|
||||
uint32_t value_size = le32_to_cpu(n->header.value_size);
|
||||
@@ -79,7 +79,7 @@ static void node_shift(struct node *n, int shift)
|
||||
}
|
||||
}
|
||||
|
||||
static void node_copy(struct node *left, struct node *right, int shift)
|
||||
static void node_copy(struct btree_node *left, struct btree_node *right, int shift)
|
||||
{
|
||||
uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
|
||||
uint32_t value_size = le32_to_cpu(left->header.value_size);
|
||||
@@ -108,7 +108,7 @@ static void node_copy(struct node *left, struct node *right, int shift)
|
||||
/*
|
||||
* Delete a specific entry from a leaf node.
|
||||
*/
|
||||
static void delete_at(struct node *n, unsigned index)
|
||||
static void delete_at(struct btree_node *n, unsigned index)
|
||||
{
|
||||
unsigned nr_entries = le32_to_cpu(n->header.nr_entries);
|
||||
unsigned nr_to_copy = nr_entries - (index + 1);
|
||||
@@ -128,7 +128,7 @@ static void delete_at(struct node *n, unsigned index)
|
||||
n->header.nr_entries = cpu_to_le32(nr_entries - 1);
|
||||
}
|
||||
|
||||
static unsigned merge_threshold(struct node *n)
|
||||
static unsigned merge_threshold(struct btree_node *n)
|
||||
{
|
||||
return le32_to_cpu(n->header.max_entries) / 3;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ static unsigned merge_threshold(struct node *n)
|
||||
struct child {
|
||||
unsigned index;
|
||||
struct dm_block *block;
|
||||
struct node *n;
|
||||
struct btree_node *n;
|
||||
};
|
||||
|
||||
static struct dm_btree_value_type le64_type = {
|
||||
@@ -147,7 +147,7 @@ static struct dm_btree_value_type le64_type = {
|
||||
.equal = NULL
|
||||
};
|
||||
|
||||
static int init_child(struct dm_btree_info *info, struct node *parent,
|
||||
static int init_child(struct dm_btree_info *info, struct btree_node *parent,
|
||||
unsigned index, struct child *result)
|
||||
{
|
||||
int r, inc;
|
||||
@@ -177,7 +177,7 @@ static int exit_child(struct dm_btree_info *info, struct child *c)
|
||||
return dm_tm_unlock(info->tm, c->block);
|
||||
}
|
||||
|
||||
static void shift(struct node *left, struct node *right, int count)
|
||||
static void shift(struct btree_node *left, struct btree_node *right, int count)
|
||||
{
|
||||
uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
|
||||
uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
|
||||
@@ -203,11 +203,11 @@ static void shift(struct node *left, struct node *right, int count)
|
||||
right->header.nr_entries = cpu_to_le32(nr_right + count);
|
||||
}
|
||||
|
||||
static void __rebalance2(struct dm_btree_info *info, struct node *parent,
|
||||
static void __rebalance2(struct dm_btree_info *info, struct btree_node *parent,
|
||||
struct child *l, struct child *r)
|
||||
{
|
||||
struct node *left = l->n;
|
||||
struct node *right = r->n;
|
||||
struct btree_node *left = l->n;
|
||||
struct btree_node *right = r->n;
|
||||
uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
|
||||
uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
|
||||
unsigned threshold = 2 * merge_threshold(left) + 1;
|
||||
@@ -239,7 +239,7 @@ static int rebalance2(struct shadow_spine *s, struct dm_btree_info *info,
|
||||
unsigned left_index)
|
||||
{
|
||||
int r;
|
||||
struct node *parent;
|
||||
struct btree_node *parent;
|
||||
struct child left, right;
|
||||
|
||||
parent = dm_block_data(shadow_current(s));
|
||||
@@ -270,9 +270,9 @@ static int rebalance2(struct shadow_spine *s, struct dm_btree_info *info,
|
||||
* in right, then rebalance2. This wastes some cpu, but I want something
|
||||
* simple atm.
|
||||
*/
|
||||
static void delete_center_node(struct dm_btree_info *info, struct node *parent,
|
||||
static void delete_center_node(struct dm_btree_info *info, struct btree_node *parent,
|
||||
struct child *l, struct child *c, struct child *r,
|
||||
struct node *left, struct node *center, struct node *right,
|
||||
struct btree_node *left, struct btree_node *center, struct btree_node *right,
|
||||
uint32_t nr_left, uint32_t nr_center, uint32_t nr_right)
|
||||
{
|
||||
uint32_t max_entries = le32_to_cpu(left->header.max_entries);
|
||||
@@ -301,9 +301,9 @@ static void delete_center_node(struct dm_btree_info *info, struct node *parent,
|
||||
/*
|
||||
* Redistributes entries among 3 sibling nodes.
|
||||
*/
|
||||
static void redistribute3(struct dm_btree_info *info, struct node *parent,
|
||||
static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
|
||||
struct child *l, struct child *c, struct child *r,
|
||||
struct node *left, struct node *center, struct node *right,
|
||||
struct btree_node *left, struct btree_node *center, struct btree_node *right,
|
||||
uint32_t nr_left, uint32_t nr_center, uint32_t nr_right)
|
||||
{
|
||||
int s;
|
||||
@@ -343,12 +343,12 @@ static void redistribute3(struct dm_btree_info *info, struct node *parent,
|
||||
*key_ptr(parent, r->index) = right->keys[0];
|
||||
}
|
||||
|
||||
static void __rebalance3(struct dm_btree_info *info, struct node *parent,
|
||||
static void __rebalance3(struct dm_btree_info *info, struct btree_node *parent,
|
||||
struct child *l, struct child *c, struct child *r)
|
||||
{
|
||||
struct node *left = l->n;
|
||||
struct node *center = c->n;
|
||||
struct node *right = r->n;
|
||||
struct btree_node *left = l->n;
|
||||
struct btree_node *center = c->n;
|
||||
struct btree_node *right = r->n;
|
||||
|
||||
uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
|
||||
uint32_t nr_center = le32_to_cpu(center->header.nr_entries);
|
||||
@@ -371,7 +371,7 @@ static int rebalance3(struct shadow_spine *s, struct dm_btree_info *info,
|
||||
unsigned left_index)
|
||||
{
|
||||
int r;
|
||||
struct node *parent = dm_block_data(shadow_current(s));
|
||||
struct btree_node *parent = dm_block_data(shadow_current(s));
|
||||
struct child left, center, right;
|
||||
|
||||
/*
|
||||
@@ -421,7 +421,7 @@ static int get_nr_entries(struct dm_transaction_manager *tm,
|
||||
{
|
||||
int r;
|
||||
struct dm_block *block;
|
||||
struct node *n;
|
||||
struct btree_node *n;
|
||||
|
||||
r = dm_tm_read_lock(tm, b, &btree_node_validator, &block);
|
||||
if (r)
|
||||
@@ -438,7 +438,7 @@ static int rebalance_children(struct shadow_spine *s,
|
||||
{
|
||||
int i, r, has_left_sibling, has_right_sibling;
|
||||
uint32_t child_entries;
|
||||
struct node *n;
|
||||
struct btree_node *n;
|
||||
|
||||
n = dm_block_data(shadow_current(s));
|
||||
|
||||
@@ -483,7 +483,7 @@ static int rebalance_children(struct shadow_spine *s,
|
||||
return r;
|
||||
}
|
||||
|
||||
static int do_leaf(struct node *n, uint64_t key, unsigned *index)
|
||||
static int do_leaf(struct btree_node *n, uint64_t key, unsigned *index)
|
||||
{
|
||||
int i = lower_bound(n, key);
|
||||
|
||||
@@ -506,7 +506,7 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info,
|
||||
uint64_t key, unsigned *index)
|
||||
{
|
||||
int i = *index, r;
|
||||
struct node *n;
|
||||
struct btree_node *n;
|
||||
|
||||
for (;;) {
|
||||
r = shadow_step(s, root, vt);
|
||||
@@ -556,7 +556,7 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,
|
||||
unsigned level, last_level = info->levels - 1;
|
||||
int index = 0, r = 0;
|
||||
struct shadow_spine spine;
|
||||
struct node *n;
|
||||
struct btree_node *n;
|
||||
|
||||
init_shadow_spine(&spine, info);
|
||||
for (level = 0; level < info->levels; level++) {
|
||||
|
||||
Reference in New Issue
Block a user