diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2015-07-06 11:55:41 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-08-12 11:32:19 -0400 |
commit | 8c747fd0c3f514233afaca98139c03cca2cf2d2f (patch) | |
tree | 4d122d214d14d36cc6adb1ad2170bf8a15a5eae3 | |
parent | 0a8d4c3ef8f14cbd26d97767e3676722d4eebee5 (diff) | |
download | op-kernel-dev-8c747fd0c3f514233afaca98139c03cca2cf2d2f.zip op-kernel-dev-8c747fd0c3f514233afaca98139c03cca2cf2d2f.tar.gz |
dm btree remove: remove unused function get_nr_entries()
rebalance_children() calls get_nr_entries() and assigns the result to an
unused local 'child_entries' variable. Remove get_nr_entries() and
cleanup rebalance_children() accordingly.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/persistent-data/dm-btree-remove.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c index 4222f77..421a36c 100644 --- a/drivers/md/persistent-data/dm-btree-remove.c +++ b/drivers/md/persistent-data/dm-btree-remove.c @@ -409,29 +409,11 @@ static int rebalance3(struct shadow_spine *s, struct dm_btree_info *info, return 0; } -static int get_nr_entries(struct dm_transaction_manager *tm, - dm_block_t b, uint32_t *result) -{ - int r; - struct dm_block *block; - struct btree_node *n; - - r = dm_tm_read_lock(tm, b, &btree_node_validator, &block); - if (r) - return r; - - n = dm_block_data(block); - *result = le32_to_cpu(n->header.nr_entries); - - return dm_tm_unlock(tm, block); -} - static int rebalance_children(struct shadow_spine *s, struct dm_btree_info *info, struct dm_btree_value_type *vt, uint64_t key) { int i, r, has_left_sibling, has_right_sibling; - uint32_t child_entries; struct btree_node *n; n = dm_block_data(shadow_current(s)); @@ -458,10 +440,6 @@ static int rebalance_children(struct shadow_spine *s, if (i < 0) return -ENODATA; - r = get_nr_entries(info->tm, value64(n, i), &child_entries); - if (r) - return r; - has_left_sibling = i > 0; has_right_sibling = i < (le32_to_cpu(n->header.nr_entries) - 1); |