diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2023-01-25 23:14:58 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-02-14 22:23:06 +0300 |
commit | 86a3238c7b9b759cb864f4f768ab2e24687dc0e6 (patch) | |
tree | a85375c77a8a25923250d1dfe9b7b6a3d2594029 /drivers/md/persistent-data | |
parent | 238d991f054a553e823d12b0ffd52aaeedd65f70 (diff) | |
download | linux-86a3238c7b9b759cb864f4f768ab2e24687dc0e6.tar.xz |
dm: change "unsigned" to "unsigned int"
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/persistent-data')
-rw-r--r-- | drivers/md/persistent-data/dm-array.c | 69 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-array.h | 2 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-bitset.c | 12 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-block-manager.c | 16 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-block-manager.h | 6 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree-remove.c | 46 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree-spine.c | 4 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree.c | 98 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree.h | 12 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-persistent-data-internal.h | 6 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-space-map-common.c | 28 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-space-map-metadata.c | 20 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-transaction-manager.c | 16 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-transaction-manager.h | 2 |
14 files changed, 169 insertions, 168 deletions
diff --git a/drivers/md/persistent-data/dm-array.c b/drivers/md/persistent-data/dm-array.c index 0f77b557231f..f968c17ddbcf 100644 --- a/drivers/md/persistent-data/dm-array.c +++ b/drivers/md/persistent-data/dm-array.c @@ -69,8 +69,8 @@ static int array_block_check(struct dm_block_validator *v, CSUM_XOR)); if (csum_disk != bh_le->csum) { DMERR_LIMIT("array_block_check failed: csum %u != wanted %u", - (unsigned) le32_to_cpu(csum_disk), - (unsigned) le32_to_cpu(bh_le->csum)); + (unsigned int) le32_to_cpu(csum_disk), + (unsigned int) le32_to_cpu(bh_le->csum)); return -EILSEQ; } @@ -95,7 +95,7 @@ static struct dm_block_validator array_validator = { * index - The index into _this_ specific block. */ static void *element_at(struct dm_array_info *info, struct array_block *ab, - unsigned index) + unsigned int index) { unsigned char *entry = (unsigned char *) (ab + 1); @@ -109,9 +109,9 @@ static void *element_at(struct dm_array_info *info, struct array_block *ab, * in an array block. */ static void on_entries(struct dm_array_info *info, struct array_block *ab, - void (*fn)(void *, const void *, unsigned)) + void (*fn)(void *, const void *, unsigned int)) { - unsigned nr_entries = le32_to_cpu(ab->nr_entries); + unsigned int nr_entries = le32_to_cpu(ab->nr_entries); fn(info->value_type.context, element_at(info, ab, 0), nr_entries); } @@ -172,7 +172,7 @@ static int alloc_ablock(struct dm_array_info *info, size_t size_of_block, * the current number of entries. */ static void fill_ablock(struct dm_array_info *info, struct array_block *ab, - const void *value, unsigned new_nr) + const void *value, unsigned int new_nr) { uint32_t nr_entries, delta, i; struct dm_btree_value_type *vt = &info->value_type; @@ -195,7 +195,7 @@ static void fill_ablock(struct dm_array_info *info, struct array_block *ab, * entries. */ static void trim_ablock(struct dm_array_info *info, struct array_block *ab, - unsigned new_nr) + unsigned int new_nr) { uint32_t nr_entries, delta; struct dm_btree_value_type *vt = &info->value_type; @@ -248,7 +248,7 @@ static void unlock_ablock(struct dm_array_info *info, struct dm_block *block) * / max_entries). */ static int lookup_ablock(struct dm_array_info *info, dm_block_t root, - unsigned index, struct dm_block **block, + unsigned int index, struct dm_block **block, struct array_block **ab) { int r; @@ -296,7 +296,7 @@ static int __shadow_ablock(struct dm_array_info *info, dm_block_t b, * The shadow op will often be a noop. Only insert if it really * copied data. */ -static int __reinsert_ablock(struct dm_array_info *info, unsigned index, +static int __reinsert_ablock(struct dm_array_info *info, unsigned int index, struct dm_block *block, dm_block_t b, dm_block_t *root) { @@ -322,7 +322,7 @@ static int __reinsert_ablock(struct dm_array_info *info, unsigned index, * for both the current root block, and the new one. */ static int shadow_ablock(struct dm_array_info *info, dm_block_t *root, - unsigned index, struct dm_block **block, + unsigned int index, struct dm_block **block, struct array_block **ab) { int r; @@ -347,7 +347,7 @@ static int shadow_ablock(struct dm_array_info *info, dm_block_t *root, */ static int insert_new_ablock(struct dm_array_info *info, size_t size_of_block, uint32_t max_entries, - unsigned block_index, uint32_t nr, + unsigned int block_index, uint32_t nr, const void *value, dm_block_t *root) { int r; @@ -366,8 +366,8 @@ static int insert_new_ablock(struct dm_array_info *info, size_t size_of_block, } static int insert_full_ablocks(struct dm_array_info *info, size_t size_of_block, - unsigned begin_block, unsigned end_block, - unsigned max_entries, const void *value, + unsigned int begin_block, unsigned int end_block, + unsigned int max_entries, const void *value, dm_block_t *root) { int r = 0; @@ -403,20 +403,20 @@ struct resize { /* * Maximum nr entries in an array block. */ - unsigned max_entries; + unsigned int max_entries; /* * nr of completely full blocks in the array. * * 'old' refers to before the resize, 'new' after. */ - unsigned old_nr_full_blocks, new_nr_full_blocks; + unsigned int old_nr_full_blocks, new_nr_full_blocks; /* * Number of entries in the final block. 0 iff only full blocks in * the array. */ - unsigned old_nr_entries_in_last_block, new_nr_entries_in_last_block; + unsigned int old_nr_entries_in_last_block, new_nr_entries_in_last_block; /* * The default value used when growing the array. @@ -431,8 +431,8 @@ struct resize { * begin_index - the index of the first array block to remove. * end_index - the one-past-the-end value. ie. this block is not removed. */ -static int drop_blocks(struct resize *resize, unsigned begin_index, - unsigned end_index) +static int drop_blocks(struct resize *resize, unsigned int begin_index, + unsigned int end_index) { int r; @@ -450,8 +450,8 @@ static int drop_blocks(struct resize *resize, unsigned begin_index, /* * Calculates how many blocks are needed for the array. */ -static unsigned total_nr_blocks_needed(unsigned nr_full_blocks, - unsigned nr_entries_in_last_block) +static unsigned int total_nr_blocks_needed(unsigned int nr_full_blocks, + unsigned int nr_entries_in_last_block) { return nr_full_blocks + (nr_entries_in_last_block ? 1 : 0); } @@ -462,7 +462,7 @@ static unsigned total_nr_blocks_needed(unsigned nr_full_blocks, static int shrink(struct resize *resize) { int r; - unsigned begin, end; + unsigned int begin, end; struct dm_block *block; struct array_block *ab; @@ -528,7 +528,7 @@ static int grow_add_tail_block(struct resize *resize) static int grow_needs_more_blocks(struct resize *resize) { int r; - unsigned old_nr_blocks = resize->old_nr_full_blocks; + unsigned int old_nr_blocks = resize->old_nr_full_blocks; if (resize->old_nr_entries_in_last_block > 0) { old_nr_blocks++; @@ -570,11 +570,11 @@ static int grow(struct resize *resize) * These are the value_type functions for the btree elements, which point * to array blocks. */ -static void block_inc(void *context, const void *value, unsigned count) +static void block_inc(void *context, const void *value, unsigned int count) { const __le64 *block_le = value; struct dm_array_info *info = context; - unsigned i; + unsigned int i; for (i = 0; i < count; i++, block_le++) dm_tm_inc(info->btree_info.tm, le64_to_cpu(*block_le)); @@ -619,9 +619,9 @@ static void __block_dec(void *context, const void *value) dm_tm_dec(info->btree_info.tm, b); } -static void block_dec(void *context, const void *value, unsigned count) +static void block_dec(void *context, const void *value, unsigned int count) { - unsigned i; + unsigned int i; for (i = 0; i < count; i++, value += sizeof(__le64)) __block_dec(context, value); } @@ -701,10 +701,11 @@ int dm_array_resize(struct dm_array_info *info, dm_block_t root, EXPORT_SYMBOL_GPL(dm_array_resize); static int populate_ablock_with_values(struct dm_array_info *info, struct array_block *ab, - value_fn fn, void *context, unsigned base, unsigned new_nr) + value_fn fn, void *context, + unsigned int base, unsigned int new_nr) { int r; - unsigned i; + unsigned int i; struct dm_btree_value_type *vt = &info->value_type; BUG_ON(le32_to_cpu(ab->nr_entries)); @@ -729,7 +730,7 @@ int dm_array_new(struct dm_array_info *info, dm_block_t *root, int r; struct dm_block *block; struct array_block *ab; - unsigned block_index, end_block, size_of_block, max_entries; + unsigned int block_index, end_block, size_of_block, max_entries; r = dm_array_empty(info, root); if (r) @@ -777,7 +778,7 @@ int dm_array_get_value(struct dm_array_info *info, dm_block_t root, struct dm_block *block; struct array_block *ab; size_t size_of_block; - unsigned entry, max_entries; + unsigned int entry, max_entries; size_of_block = dm_bm_block_size(dm_tm_get_bm(info->btree_info.tm)); max_entries = calc_max_entries(info->value_type.size, size_of_block); @@ -805,8 +806,8 @@ static int array_set_value(struct dm_array_info *info, dm_block_t root, struct dm_block *block; struct array_block *ab; size_t size_of_block; - unsigned max_entries; - unsigned entry; + unsigned int max_entries; + unsigned int entry; void *old_value; struct dm_btree_value_type *vt = &info->value_type; @@ -862,9 +863,9 @@ static int walk_ablock(void *context, uint64_t *keys, void *leaf) struct walk_info *wi = context; int r; - unsigned i; + unsigned int i; __le64 block_le; - unsigned nr_entries, max_entries; + unsigned int nr_entries, max_entries; struct dm_block *block; struct array_block *ab; diff --git a/drivers/md/persistent-data/dm-array.h b/drivers/md/persistent-data/dm-array.h index 331cc6db3850..91d6165427b3 100644 --- a/drivers/md/persistent-data/dm-array.h +++ b/drivers/md/persistent-data/dm-array.h @@ -199,7 +199,7 @@ struct dm_array_cursor { struct dm_block *block; struct array_block *ab; - unsigned index; + unsigned int index; }; int dm_array_cursor_begin(struct dm_array_info *info, diff --git a/drivers/md/persistent-data/dm-bitset.c b/drivers/md/persistent-data/dm-bitset.c index b56a9690a300..72734ff6fefb 100644 --- a/drivers/md/persistent-data/dm-bitset.c +++ b/drivers/md/persistent-data/dm-bitset.c @@ -42,7 +42,7 @@ EXPORT_SYMBOL_GPL(dm_bitset_empty); struct packer_context { bit_value_fn fn; - unsigned nr_bits; + unsigned int nr_bits; void *context; }; @@ -50,7 +50,7 @@ static int pack_bits(uint32_t index, void *value, void *context) { int r; struct packer_context *p = context; - unsigned bit, nr = min(64u, p->nr_bits - (index * 64)); + unsigned int bit, nr = min(64u, p->nr_bits - (index * 64)); uint64_t word = 0; bool bv; @@ -148,7 +148,7 @@ static int get_array_entry(struct dm_disk_bitset *info, dm_block_t root, uint32_t index, dm_block_t *new_root) { int r; - unsigned array_index = index / BITS_PER_ARRAY_ENTRY; + unsigned int array_index = index / BITS_PER_ARRAY_ENTRY; if (info->current_index_set) { if (info->current_index == array_index) @@ -166,7 +166,7 @@ int dm_bitset_set_bit(struct dm_disk_bitset *info, dm_block_t root, uint32_t index, dm_block_t *new_root) { int r; - unsigned b = index % BITS_PER_ARRAY_ENTRY; + unsigned int b = index % BITS_PER_ARRAY_ENTRY; r = get_array_entry(info, root, index, new_root); if (r) @@ -183,7 +183,7 @@ int dm_bitset_clear_bit(struct dm_disk_bitset *info, dm_block_t root, uint32_t index, dm_block_t *new_root) { int r; - unsigned b = index % BITS_PER_ARRAY_ENTRY; + unsigned int b = index % BITS_PER_ARRAY_ENTRY; r = get_array_entry(info, root, index, new_root); if (r) @@ -200,7 +200,7 @@ int dm_bitset_test_bit(struct dm_disk_bitset *info, dm_block_t root, uint32_t index, dm_block_t *new_root, bool *result) { int r; - unsigned b = index % BITS_PER_ARRAY_ENTRY; + unsigned int b = index % BITS_PER_ARRAY_ENTRY; r = get_array_entry(info, root, index, new_root); if (r) diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index 81c8f72664b9..af234c1176a7 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -58,10 +58,10 @@ struct waiter { int wants_write; }; -static unsigned __find_holder(struct block_lock *lock, +static unsigned int __find_holder(struct block_lock *lock, struct task_struct *task) { - unsigned i; + unsigned int i; for (i = 0; i < MAX_HOLDERS; i++) if (lock->holders[i] == task) @@ -74,7 +74,7 @@ static unsigned __find_holder(struct block_lock *lock, /* call this *after* you increment lock->count */ static void __add_holder(struct block_lock *lock, struct task_struct *task) { - unsigned h = __find_holder(lock, NULL); + unsigned int h = __find_holder(lock, NULL); #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING struct stack_store *t; #endif @@ -91,14 +91,14 @@ static void __add_holder(struct block_lock *lock, struct task_struct *task) /* call this *before* you decrement lock->count */ static void __del_holder(struct block_lock *lock, struct task_struct *task) { - unsigned h = __find_holder(lock, task); + unsigned int h = __find_holder(lock, task); lock->holders[h] = NULL; put_task_struct(task); } static int __check_holder(struct block_lock *lock) { - unsigned i; + unsigned int i; for (i = 0; i < MAX_HOLDERS; i++) { if (lock->holders[i] == current) { @@ -377,8 +377,8 @@ struct dm_block_manager { }; struct dm_block_manager *dm_block_manager_create(struct block_device *bdev, - unsigned block_size, - unsigned max_held_per_thread) + unsigned int block_size, + unsigned int max_held_per_thread) { int r; struct dm_block_manager *bm; @@ -416,7 +416,7 @@ void dm_block_manager_destroy(struct dm_block_manager *bm) } EXPORT_SYMBOL_GPL(dm_block_manager_destroy); -unsigned dm_bm_block_size(struct dm_block_manager *bm) +unsigned int dm_bm_block_size(struct dm_block_manager *bm) { return dm_bufio_get_block_size(bm->bufio); } diff --git a/drivers/md/persistent-data/dm-block-manager.h b/drivers/md/persistent-data/dm-block-manager.h index 5cc605ba6f7c..5746b0f82a03 100644 --- a/drivers/md/persistent-data/dm-block-manager.h +++ b/drivers/md/persistent-data/dm-block-manager.h @@ -33,11 +33,11 @@ void *dm_block_data(struct dm_block *b); */ struct dm_block_manager; struct dm_block_manager *dm_block_manager_create( - struct block_device *bdev, unsigned block_size, - unsigned max_held_per_thread); + struct block_device *bdev, unsigned int block_size, + unsigned int max_held_per_thread); void dm_block_manager_destroy(struct dm_block_manager *bm); -unsigned dm_bm_block_size(struct dm_block_manager *bm); +unsigned int dm_bm_block_size(struct dm_block_manager *bm); dm_block_t dm_bm_nr_blocks(struct dm_block_manager *bm); /*----------------------------------------------------------------*/ diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c index d8645af16d43..19647007c687 100644 --- a/drivers/md/persistent-data/dm-btree-remove.c +++ b/drivers/md/persistent-data/dm-btree-remove.c @@ -125,10 +125,10 @@ static int node_copy(struct btree_node *left, struct btree_node *right, int shif /* * Delete a specific entry from a leaf node. */ -static void delete_at(struct btree_node *n, unsigned index) +static void delete_at(struct btree_node *n, unsigned int index) { - unsigned nr_entries = le32_to_cpu(n->header.nr_entries); - unsigned nr_to_copy = nr_entries - (index + 1); + unsigned int nr_entries = le32_to_cpu(n->header.nr_entries); + unsigned int nr_to_copy = nr_entries - (index + 1); uint32_t value_size = le32_to_cpu(n->header.value_size); BUG_ON(index >= nr_entries); @@ -145,20 +145,20 @@ static void delete_at(struct btree_node *n, unsigned index) n->header.nr_entries = cpu_to_le32(nr_entries - 1); } -static unsigned merge_threshold(struct btree_node *n) +static unsigned int merge_threshold(struct btree_node *n) { return le32_to_cpu(n->header.max_entries) / 3; } struct child { - unsigned index; + unsigned int index; struct dm_block *block; struct btree_node *n; }; static int init_child(struct dm_btree_info *info, struct dm_btree_value_type *vt, struct btree_node *parent, - unsigned index, struct child *result) + unsigned int index, struct child *result) { int r, inc; dm_block_t root; @@ -264,7 +264,7 @@ static int __rebalance2(struct dm_btree_info *info, struct btree_node *parent, /* * Rebalance. */ - unsigned target_left = (nr_left + nr_right) / 2; + unsigned int target_left = (nr_left + nr_right) / 2; ret = shift(left, right, nr_left - target_left); if (ret) return ret; @@ -274,7 +274,7 @@ static int __rebalance2(struct dm_btree_info *info, struct btree_node *parent, } static int rebalance2(struct shadow_spine *s, struct dm_btree_info *info, - struct dm_btree_value_type *vt, unsigned left_index) + struct dm_btree_value_type *vt, unsigned int left_index) { int r; struct btree_node *parent; @@ -311,7 +311,7 @@ static int delete_center_node(struct dm_btree_info *info, struct btree_node *par uint32_t nr_left, uint32_t nr_center, uint32_t nr_right) { uint32_t max_entries = le32_to_cpu(left->header.max_entries); - unsigned shift = min(max_entries - nr_left, nr_center); + unsigned int shift = min(max_entries - nr_left, nr_center); if (nr_left + shift > max_entries) { DMERR("node shift out of bounds"); @@ -352,10 +352,10 @@ static int redistribute3(struct dm_btree_info *info, struct btree_node *parent, { int s, ret; uint32_t max_entries = le32_to_cpu(left->header.max_entries); - unsigned total = nr_left + nr_center + nr_right; - unsigned target_right = total / 3; - unsigned remainder = (target_right * 3) != total; - unsigned target_left = target_right + remainder; + unsigned int total = nr_left + nr_center + nr_right; + unsigned int target_right = total / 3; + unsigned int remainder = (target_right * 3) != total; + unsigned int target_left = target_right + remainder; BUG_ON(target_left > max_entries); BUG_ON(target_right > max_entries); @@ -423,7 +423,7 @@ static int __rebalance3(struct dm_btree_info *info, struct btree_node *parent, uint32_t nr_center = le32_to_cpu(center->header.nr_entries); uint32_t nr_right = le32_to_cpu(right->header.nr_entries); - unsigned threshold = merge_threshold(left) * 4 + 1; + unsigned int threshold = merge_threshold(left) * 4 + 1; if ((left->header.max_entries != center->header.max_entries) || (center->header.max_entries != right->header.max_entries)) { @@ -441,7 +441,7 @@ static int __rebalance3(struct dm_btree_info *info, struct btree_node *parent, } static int rebalance3(struct shadow_spine *s, struct dm_btree_info *info, - struct dm_btree_value_type *vt, unsigned left_index) + struct dm_btree_value_type *vt, unsigned int left_index) { int r; struct btree_node *parent = dm_block_data(shadow_current(s)); @@ -520,7 +520,7 @@ static int rebalance_children(struct shadow_spine *s, return r; } -static int do_leaf(struct btree_node *n, uint64_t key, unsigned *index) +static int do_leaf(struct btree_node *n, uint64_t key, unsigned int *index) { int i = lower_bound(n, key); @@ -540,7 +540,7 @@ static int do_leaf(struct btree_node *n, uint64_t key, unsigned *index) */ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info, struct dm_btree_value_type *vt, dm_block_t root, - uint64_t key, unsigned *index) + uint64_t key, unsigned int *index) { int i = *index, r; struct btree_node *n; @@ -590,7 +590,7 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info, int dm_btree_remove(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, dm_block_t *new_root) { - unsigned level, last_level = info->levels - 1; + unsigned int level, last_level = info->levels - 1; int index = 0, r = 0; struct shadow_spine spine; struct btree_node *n; @@ -602,7 +602,7 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root, r = remove_raw(&spine, info, (level == last_level ? &info->value_type : &le64_vt), - root, keys[level], (unsigned *)&index); + root, keys[level], (unsigned int *)&index); if (r < 0) break; @@ -686,9 +686,9 @@ static int remove_nearest(struct shadow_spine *s, struct dm_btree_info *info, static int remove_one(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, uint64_t end_key, - dm_block_t *new_root, unsigned *nr_removed) + dm_block_t *new_root, unsigned int *nr_removed) { - unsigned level, last_level = info->levels - 1; + unsigned int level, last_level = info->levels - 1; int index = 0, r = 0; struct shadow_spine spine; struct btree_node *n; @@ -699,7 +699,7 @@ static int remove_one(struct dm_btree_info *info, dm_block_t root, init_shadow_spine(&spine, info); for (level = 0; level < last_level; level++) { r = remove_raw(&spine, info, &le64_vt, - root, keys[level], (unsigned *) &index); + root, keys[level], (unsigned int *) &index); if (r < 0) goto out; @@ -743,7 +743,7 @@ out: int dm_btree_remove_leaves(struct dm_btree_info *info, dm_block_t root, uint64_t *first_key, uint64_t end_key, - dm_block_t *new_root, unsigned *nr_removed) + dm_block_t *new_root, unsigned int *nr_removed) { int r; diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c index 9c3cdbaf47a2..a04784bab21e 100644 --- a/drivers/md/persistent-data/dm-btree-spine.c +++ b/drivers/md/persistent-data/dm-btree-spine.c @@ -235,12 +235,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); } diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index a4b2a9ea7cc7..f74822661022 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -24,8 +24,8 @@ static void memcpy_disk(void *dest, const void *src, size_t len) __dm_unbless_for_disk(src); } -static void array_insert(void *base, size_t elt_size, unsigned nr_elts, - unsigned index, void *elt) +static void array_insert(void *base, size_t elt_size, unsigned int nr_elts, + unsigned int index, void *elt) __dm_written_to_disk(elt) { if (index < nr_elts) @@ -81,7 +81,7 @@ void inc_children(struct dm_transaction_manager *tm, struct btree_node *n, vt->inc(vt->context, value_ptr(n, 0), nr_entries); } -static int insert_at(size_t value_size, struct btree_node *node, unsigned index, +static int insert_at(size_t value_size, struct btree_node *node, unsigned int index, uint64_t key, void *value) __dm_written_to_disk(value) { @@ -163,9 +163,9 @@ EXPORT_SYMBOL_GPL(dm_btree_empty); struct frame { struct dm_block *b; struct btree_node *n; - unsigned level; - unsigned nr_children; - unsigned current_child; + unsigned int level; + unsigned int nr_children; + unsigned int current_child; }; struct del_stack { @@ -194,7 +194,7 @@ static int unprocessed_frames(struct del_stack *s) static void prefetch_children(struct del_stack *s, struct frame *f) { - unsigned i; + unsigned int i; struct dm_block_manager *bm = dm_tm_get_bm(s->tm); for (i = 0; i < f->nr_children; i++) @@ -206,7 +206,7 @@ static bool is_internal_level(struct dm_btree_info *info, struct frame *f) return f->level < (info->levels - 1); } -static int push_frame(struct del_stack *s, dm_block_t b, unsigned level) +static int push_frame(struct del_stack *s, dm_block_t b, unsigned int level) { int r; uint32_t ref_count; @@ -372,7 +372,7 @@ static int btree_lookup_raw(struct ro_spine *s, dm_block_t block, uint64_t key, int dm_btree_lookup(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, void *value_le) { - unsigned level, last_level = info->levels - 1; + unsigned int level, last_level = info->levels - 1; int r = -ENODATA; uint64_t rkey; __le64 internal_value_le; @@ -468,7 +468,7 @@ out: int dm_btree_lookup_next(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, uint64_t *rkey, void *value_le) { - unsigned level; + unsigned int level; int r = -ENODATA; __le64 internal_value_le; struct ro_spine spine; @@ -503,9 +503,9 @@ EXPORT_SYMBOL_GPL(dm_btree_lookup_next); * Copies entries from one region of a btree node to another. The regions * must not overlap. */ -static void copy_entries(struct btree_node *dest, unsigned dest_offset, - struct btree_node *src, unsigned src_offset, - unsigned count) +static void copy_entries(struct btree_node *dest, unsigned int dest_offset, + struct btree_node *src, unsigned int src_offset, + unsigned int count) { size_t value_size = le32_to_cpu(dest->header.value_size); memcpy(dest->keys + dest_offset, src->keys + src_offset, count * sizeof(uint64_t)); @@ -516,9 +516,9 @@ static void copy_entries(struct btree_node *dest, unsigned dest_offset, * Moves entries from one region fo a btree node to another. The regions * may overlap. */ -static void move_entries(struct btree_node *dest, unsigned dest_offset, - struct btree_node *src, unsigned src_offset, - unsigned count) +static void move_entries(struct btree_node *dest, unsigned int dest_offset, + struct btree_node *src, unsigned int src_offset, + unsigned int count) { size_t value_size = le32_to_cpu(dest->header.value_size); memmove(dest->keys + dest_offset, src->keys + src_offset, count * sizeof(uint64_t)); @@ -529,7 +529,7 @@ static void move_entries(struct btree_node *dest, unsigned dest_offset, * Erases the first 'count' entries of a btree node, shifting following * entries down into their place. */ -static void shift_down(struct btree_node *n, unsigned count) +static void shift_down(struct btree_node *n, unsigned int count) { move_entries(n, 0, n, count, le32_to_cpu(n->header.nr_entries) - count); } @@ -538,7 +538,7 @@ static void shift_down(struct btree_node *n, unsigned count) * Moves entries in a btree node up 'count' places, making space for * new entries at the start of the node. */ -static void shift_up(struct btree_node *n, unsigned count) +static void shift_up(struct btree_node *n, unsigned int count) { move_entries(n, count, n, 0, le32_to_cpu(n->header.nr_entries)); } @@ -549,18 +549,18 @@ static void shift_up(struct btree_node *n, unsigned count) */ static void redistribute2(struct btree_node *left, struct btree_node *right) { - unsigned nr_left = le32_to_cpu(left->header.nr_entries); - unsigned nr_right = le32_to_cpu(right->header.nr_entries); - unsigned total = nr_left + nr_right; - unsigned target_left = total / 2; - unsigned target_right = total - target_left; + unsigned int nr_left = le32_to_cpu(left->header.nr_entries); + unsigned int nr_right = le32_to_cpu(right->header.nr_entries); + unsigned int total = nr_left + nr_right; + unsigned int target_left = total / 2; + unsigned int target_right = total - target_left; if (nr_left < target_left) { - unsigned delta = target_left - nr_left; + unsigned int delta = target_left - nr_left; copy_entries(left, nr_left, right, 0, delta); shift_down(right, delta); } else if (nr_left > target_left) { - unsigned delta = nr_left - target_left; + unsigned int delta = nr_left - target_left; if (nr_right) shift_up(right, delta); copy_entries(right, 0, left, target_left, delta); @@ -577,10 +577,10 @@ static void redistribute2(struct btree_node *left, struct btree_node *right) static void redistribute3(struct btree_node *left, struct btree_node *center, struct btree_node *right) { - unsigned nr_left = le32_to_cpu(left->header.nr_entries); - unsigned nr_center = le32_to_cpu(center->header.nr_entries); - unsigned nr_right = le32_to_cpu(right->header.nr_entries); - unsigned total, target_left, target_center, target_right; + unsigned int nr_left = le32_to_cpu(left->header.nr_entries); + unsigned int nr_center = le32_to_cpu(center->header.nr_entries); + unsigned int nr_right = le32_to_cpu(right->header.nr_entries); + unsigned int total, target_left, target_center, target_right; BUG_ON(nr_center); @@ -590,19 +590,19 @@ static void redistribute3(struct btree_node *left, struct btree_node *center, target_right = (total - target_left - target_center); if (nr_left < target_left) { - unsigned left_short = target_left - nr_left; + unsigned int left_short = target_left - nr_left; copy_entries(left, nr_left, right, 0, left_short); copy_entries(center, 0, right, left_short, target_center); shift_down(right, nr_right - target_right); } else if (nr_left < (target_left + target_center)) { - unsigned left_to_center = nr_left - target_left; + unsigned int left_to_center = nr_left - target_left; copy_entries(center, 0, left, target_left, left_to_center); copy_entries(center, left_to_center, right, 0, target_center - left_to_center); shift_down(right, nr_right - target_right); } else { - unsigned right_short = target_right - nr_right; + unsigned int right_short = target_right - nr_right; shift_up(right, right_short); copy_entries(right, 0, left, nr_left - right_short, right_short); copy_entries(center, 0, left, target_left, nr_left - target_left); @@ -643,7 +643,7 @@ static void redistribute3(struct btree_node *left, struct btree_node *center, * * Where A* is a shadow of A. */ -static int split_one_into_two(struct shadow_spine *s, unsigned parent_index, +static int split_one_into_two(struct shadow_spine *s, unsigned int parent_index, struct dm_btree_value_type *vt, uint64_t key) { int r; @@ -697,7 +697,7 @@ static int split_one_into_two(struct shadow_spine *s, unsigned parent_index, * to the new shadow. */ static int shadow_child(struct dm_btree_info *info, struct dm_btree_value_type *vt, - struct btree_node *parent, unsigned index, + struct btree_node *parent, unsigned int index, struct dm_block **result) { int r, inc; @@ -726,11 +726,11 @@ static int shadow_child(struct dm_btree_info *info, struct dm_btree_value_type * * Splits two nodes into three. This is more work, but results in fuller * nodes, so saves metadata space. */ -static int split_two_into_three(struct shadow_spine *s, unsigned parent_index, +static int split_two_into_three(struct shadow_spine *s, unsigned int parent_index, struct dm_btree_value_type *vt, uint64_t key) { int r; - unsigned middle_index; + unsigned int middle_index; struct dm_block *left, *middle, *right, *parent; struct btree_node *ln, *rn, *mn, *pn; __le64 location; @@ -831,7 +831,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) { int r; size_t size; - unsigned nr_left, nr_right; + unsigned int nr_left, nr_right; struct dm_block *left, *right, *new_parent; struct btree_node *pn, *ln, *rn; __le64 val; @@ -905,7 +905,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) * Redistributes a node's entries with its left sibling. */ static int rebalance_left(struct shadow_spine *s, struct dm_btree_value_type *vt, - unsigned parent_index, uint64_t key) + unsigned int parent_index, uint64_t key) { int r; struct dm_block *sib; @@ -934,7 +934,7 @@ static int rebalance_left(struct shadow_spine *s, struct dm_btree_value_type *vt * Redistributes a nodes entries with its right sibling. */ static int rebalance_right(struct shadow_spine *s, struct dm_btree_value_type *vt, - unsigned parent_index, uint64_t key) + unsigned int parent_index, uint64_t key) { int r; struct dm_block *sib; @@ -962,10 +962,10 @@ static int rebalance_right(struct shadow_spine *s, struct dm_btree_value_type *v /* * Returns the number of spare entries in a node. */ -static int get_node_free_space(struct dm_btree_info *info, dm_block_t b, unsigned *space) +static int get_node_free_space(struct dm_btree_info *info, dm_block_t b, unsigned int *space) { int r; - unsigned nr_entries; + unsigned int nr_entries; struct dm_block *block; struct btree_node *node; @@ -991,12 +991,12 @@ static int get_node_free_space(struct dm_btree_info *info, dm_block_t b, unsigne */ #define SPACE_THRESHOLD 8 static int rebalance_or_split(struct shadow_spine *s, struct dm_btree_value_type *vt, - unsigned parent_index, uint64_t key) + unsigned int parent_index, uint64_t key) { int r; struct btree_node *parent = dm_block_data(shadow_parent(s)); - unsigned nr_parent = le32_to_cpu(parent->header.nr_entries); - unsigned free_space; + unsigned int nr_parent = le32_to_cpu(parent->header.nr_entries); + unsigned int free_space; int left_shared = 0, right_shared = 0; /* Should we move entries to the left sibling? */ @@ -1081,7 +1081,7 @@ static bool has_space_for_insert(struct btree_node *node, uint64_t key) static int btree_insert_raw(struct shadow_spine *s, dm_block_t root, struct dm_btree_value_type *vt, - uint64_t key, unsigned *index) + uint64_t key, unsigned int *index) { int r, i = *index, top = 1; struct btree_node *node; @@ -1215,7 +1215,7 @@ int btree_get_overwrite_leaf(struct dm_btree_info *info, dm_block_t root, } static bool need_insert(struct btree_node *node, uint64_t *keys, - unsigned level, unsigned index) + unsigned int level, unsigned int index) { return ((index >= le32_to_cpu(node->header.nr_entries)) || (le64_to_cpu(node->keys[index]) != keys[level])); @@ -1227,7 +1227,7 @@ static int insert(struct dm_btree_info *info, dm_block_t root, __dm_written_to_disk(value) { int r; - unsigned level, index = -1, last_level = info->levels - 1; + unsigned int level, index = -1, last_level = info->levels - 1; dm_block_t block = root; struct shadow_spine spine; struct btree_node *n; @@ -1413,7 +1413,7 @@ static int walk_node(struct dm_btree_info *info, dm_block_t block, void *context) { int r; - unsigned i, nr; + unsigned int i, nr; struct dm_block *node; struct btree_node *n; uint64_t keys; @@ -1456,7 +1456,7 @@ EXPORT_SYMBOL_GPL(dm_btree_walk); static void prefetch_values(struct dm_btree_cursor *c) { - unsigned i, nr; + unsigned int i, nr; __le64 value_le; struct cursor_node *n = c->nodes + c->depth - 1; struct btree_node *bn = dm_block_data(n->b); diff --git a/drivers/md/persistent-data/dm-btree.h b/drivers/md/persistent-data/dm-btree.h index 62461e6db408..f3f2b21c82c8 100644 --- a/drivers/md/persistent-data/dm-btree.h +++ b/drivers/md/persistent-data/dm-btree.h @@ -59,14 +59,14 @@ struct dm_btree_value_type { * somewhere.) This method is _not_ called for insertion of a new * value: It is assumed the ref count is already 1. */ - void (*inc)(void *context, const void *value, unsigned count); + void (*inc)(void *context, const void *value, unsigned int count); /* * These values are being deleted. The btree takes care of freeing * the memory pointed to by @value. Often the del function just * needs to decrement a reference counts somewhere. */ - void (*dec)(void *context, const void *value, unsigned count); + void (*dec)(void *context, const void *value, unsigned int count); /* * A test for equality between two values. When a value is @@ -85,7 +85,7 @@ struct dm_btree_info { /* * Number of nested btrees. (Not the depth of a single tree.) */ - unsigned levels; + unsigned int levels; struct dm_btree_value_type value_type; }; @@ -150,7 +150,7 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root, */ int dm_btree_remove_leaves(struct dm_btree_info *info, dm_block_t root, uint64_t *keys, uint64_t end_key, - dm_block_t *new_root, unsigned *nr_removed); + dm_block_t *new_root, unsigned int *nr_removed); /* * Returns < 0 on failure. Otherwise the number of key entries that have @@ -189,7 +189,7 @@ int dm_btree_walk(struct dm_btree_info *info, dm_block_t root, struct cursor_node { struct dm_block *b; - unsigned index; + unsigned int index; }; struct dm_btree_cursor { @@ -197,7 +197,7 @@ struct dm_btree_cursor { dm_block_t root; bool prefetch_leaves; - unsigned depth; + unsigned int depth; struct cursor_node nodes[DM_BTREE_CURSOR_MAX_DEPTH]; }; diff --git a/drivers/md/persistent-data/dm-persistent-data-internal.h b/drivers/md/persistent-data/dm-persistent-data-internal.h index 4cfc27a9f8af..c482434e566b 100644 --- a/drivers/md/persistent-data/dm-persistent-data-internal.h +++ b/drivers/md/persistent-data/dm-persistent-data-internal.h @@ -10,11 +10,11 @@ #include "dm-block-manager.h" -static inline unsigned dm_hash_block(dm_block_t b, unsigned hash_mask) +static inline unsigned int dm_hash_block(dm_block_t b, unsigned int hash_mask) { - const unsigned BIG_PRIME = 4294967291UL; + const unsigned int BIG_PRIME = 4294967291UL; - return (((unsigned) b) * BIG_PRIME) & hash_mask; + return (((unsigned int) b) * BIG_PRIME) & hash_mask; } #endif /* _PERSISTENT_DATA_INTERNAL_H */ diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c index 51b57064d49d..b18b6dc1b634 100644 --- a/drivers/md/persistent-data/dm-space-map-common.c +++ b/drivers/md/persistent-data/dm-space-map-common.c @@ -127,7 +127,7 @@ static void *dm_bitmap_data(struct dm_block *b) #define WORD_MASK_HIGH 0xAAAAAAAAAAAAAAAAULL -static unsigned dm_bitmap_word_used(void *addr, unsigned b) +static unsigned int dm_bitmap_word_used(void *addr, unsigned int b) { __le64 *words_le = addr; __le64 *w_le = words_le + (b >> ENTRIES_SHIFT); @@ -138,11 +138,11 @@ static unsigned dm_bitmap_word_used(void *addr, unsigned b) return !(~bits & mask); } -static unsigned sm_lookup_bitmap(void *addr, unsigned b) +static unsigned int sm_lookup_bitmap(void *addr, unsigned int b) { __le64 *words_le = addr; __le64 *w_le = words_le + (b >> ENTRIES_SHIFT); - unsigned hi, lo; + unsigned int hi, lo; b = (b & (ENTRIES_PER_WORD - 1)) << 1; hi = !!test_bit_le(b, (void *) w_le); @@ -150,7 +150,7 @@ static unsigned sm_lookup_bitmap(void *addr, unsigned b) return (hi << 1) | lo; } -static void sm_set_bitmap(void *addr, unsigned b, unsigned val) +static void sm_set_bitmap(void *addr, unsigned int b, unsigned int val) { __le64 *words_le = addr; __le64 *w_le = words_le + (b >> ENTRIES_SHIFT); @@ -168,8 +168,8 @@ static void sm_set_bitmap(void *addr, unsigned b, unsigned val) __clear_bit_le(b + 1, (void *) w_le); } -static int sm_find_free(void *addr, unsigned begin, unsigned end, - unsigned *result) +static int sm_find_free(void *addr, unsigned int begin, unsigned int end, + unsigned int *result) { while (begin < end) { if (!(begin & (ENTRIES_PER_WORD - 1)) && @@ -238,7 +238,7 @@ int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks) { int r; dm_block_t i, nr_blocks, nr_indexes; - unsigned old_blocks, blocks; + unsigned int old_blocks, blocks; nr_blocks = ll->nr_blocks + extra_blocks; old_blocks = dm_sector_div_up(ll->nr_blocks, ll->entries_per_block); @@ -352,7 +352,7 @@ int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin, for (i = index_begin; i < index_end; i++, begin = 0) { struct dm_block *blk; - unsigned position; + unsigned int position; uint32_t bit_end; r = ll->load_ie(ll, i, &ie_disk); @@ -370,7 +370,7 @@ int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin, bit_end = (i == index_end - 1) ? end : ll->entries_per_block; r = sm_find_free(dm_bitmap_data(blk), - max_t(unsigned, begin, le32_to_cpu(ie_disk.none_free_before)), + max_t(unsigned int, begin, le32_to_cpu(ie_disk.none_free_before)), bit_end, &position); if (r == -ENOSPC) { /* @@ -1098,7 +1098,7 @@ static inline int ie_cache_writeback(struct ll_disk *ll, struct ie_cache *iec) &iec->index, &iec->ie, &ll->bitmap_root); } -static inline unsigned hash_index(dm_block_t index) +static inline unsigned int hash_index(dm_block_t index) { return dm_hash_block(index, IE_CACHE_MASK); } @@ -1107,7 +1107,7 @@ static int disk_ll_load_ie(struct ll_disk *ll, dm_block_t index, struct disk_index_entry *ie) { int r; - unsigned h = hash_index(index); + unsigned int h = hash_index(index); struct ie_cache *iec = ll->ie_cache + h; if (iec->valid) { @@ -1138,7 +1138,7 @@ static int disk_ll_save_ie(struct ll_disk *ll, dm_block_t index, struct disk_index_entry *ie) { int r; - unsigned h = hash_index(index); + unsigned int h = hash_index(index); struct ie_cache *iec = ll->ie_cache + h; ll->bitmap_index_changed = true; @@ -1165,7 +1165,7 @@ static int disk_ll_save_ie(struct ll_disk *ll, dm_block_t index, static int disk_ll_init_index(struct ll_disk *ll) { - unsigned i; + unsigned int i; for (i = 0; i < IE_CACHE_SIZE; i++) { struct ie_cache *iec = ll->ie_cache + i; iec->valid = false; @@ -1187,7 +1187,7 @@ static dm_block_t disk_ll_max_entries(struct ll_disk *ll) static int disk_ll_commit(struct ll_disk *ll) { int r = 0; - unsigned i; + unsigned int i; for (i = 0; i < IE_CACHE_SIZE; i++) { struct ie_cache *iec = ll->ie_cache + i; diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c index 69174957a05e..ec2487787617 100644 --- a/drivers/md/persistent-data/dm-space-map-metadata.c +++ b/drivers/md/persistent-data/dm-space-map-metadata.c @@ -95,8 +95,8 @@ struct block_op { }; struct bop_ring_buffer { - unsigned begin; - unsigned end; + unsigned int begin; + unsigned int end; struct block_op bops[MAX_RECURSIVE_ALLOCATIONS + 1]; }; @@ -111,9 +111,9 @@ static bool brb_empty(struct bop_ring_buffer *brb) return brb->begin == brb->end; } -static unsigned brb_next(struct bop_ring_buffer *brb, unsigned old) +static unsigned int brb_next(struct bop_ring_buffer *brb, unsigned int old) { - unsigned r = old + 1; + unsigned int r = old + 1; return r >= ARRAY_SIZE(brb->bops) ? 0 : r; } @@ -121,7 +121,7 @@ static int brb_push(struct bop_ring_buffer *brb, enum block_op_type type, dm_block_t b, dm_block_t e) { struct block_op *bop; - unsigned next = brb_next(brb, brb->end); + unsigned int next = brb_next(brb, brb->end); /* * We don't allow the last bop to be filled, this way we can @@ -172,8 +172,8 @@ struct sm_metadata { dm_block_t begin; - unsigned recursion_count; - unsigned allocated_this_transaction; + unsigned int recursion_count; + unsigned int allocated_this_transaction; struct bop_ring_buffer uncommitted; struct threshold threshold; @@ -301,9 +301,9 @@ static int sm_metadata_get_count(struct dm_space_map *sm, dm_block_t b, uint32_t *result) { int r; - unsigned i; + unsigned int i; struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); - unsigned adjustment = 0; + unsigned int adjustment = 0; /* * We may have some uncommitted adjustments to add. This list @@ -341,7 +341,7 @@ static int sm_metadata_count_is_more_than_one(struct dm_space_map *sm, dm_block_t b, int *result) { int r, adjustment = 0; - unsigned i; + unsigned int i; struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); uint32_t rc; diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 315f487e457f..a725e49cc483 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.c +++ b/drivers/md/persistent-data/dm-transaction-manager.c @@ -29,14 +29,14 @@ struct prefetch_set { dm_block_t blocks[PREFETCH_SIZE]; }; -static unsigned prefetch_hash(dm_block_t b) +static unsigned int prefetch_hash(dm_block_t b) { return hash_64(b, PREFETCH_BITS); } static void prefetch_wipe(struct prefetch_set *p) { - unsigned i; + unsigned int i; for (i = 0; i < PREFETCH_SIZE; i++) p->blocks[i] = PREFETCH_SENTINEL; } @@ -49,7 +49,7 @@ static void prefetch_init(struct prefetch_set *p) static void prefetch_add(struct prefetch_set *p, dm_block_t b) { - unsigned h = prefetch_hash(b); + unsigned int h = prefetch_hash(b); mutex_lock(&p->lock); if (p->blocks[h] == PREFETCH_SENTINEL) @@ -60,7 +60,7 @@ static void prefetch_add(struct prefetch_set *p, dm_block_t b) static void prefetch_issue(struct prefetch_set *p, struct dm_block_manager *bm) { - unsigned i; + unsigned int i; mutex_lock(&p->lock); @@ -104,7 +104,7 @@ struct dm_transaction_manager { static int is_shadow(struct dm_transaction_manager *tm, dm_block_t b) { int r = 0; - unsigned bucket = dm_hash_block(b, DM_HASH_MASK); + unsigned int bucket = dm_hash_block(b, DM_HASH_MASK); struct shadow_info *si; spin_lock(&tm->lock); @@ -124,7 +124,7 @@ static int is_shadow(struct dm_transaction_manager *tm, dm_block_t b) */ static void insert_shadow(struct dm_transaction_manager *tm, dm_block_t b) { - unsigned bucket; + unsigned int bucket; struct shadow_info *si; si = kmalloc(sizeof(*si), GFP_NOIO); @@ -394,11 +394,11 @@ void dm_tm_dec_range(struct dm_transaction_manager *tm, dm_block_t b, dm_block_t EXPORT_SYMBOL_GPL(dm_tm_dec_range); void dm_tm_with_runs(struct dm_transaction_manager *tm, - const __le64 *value_le, unsigned count, dm_tm_run_fn fn) + const __le64 *value_le, unsigned int count, dm_tm_run_fn fn) { uint64_t b, begin, end; bool in_run = false; - unsigned i; + unsigned int i; for (i = 0; i < count; i++, value_le++) { b = le64_to_cpu(*value_le); diff --git a/drivers/md/persistent-data/dm-transaction-manager.h b/drivers/md/persistent-data/dm-transaction-manager.h index 70c87ce96372..01f7e650118d 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.h +++ b/drivers/md/persistent-data/dm-transaction-manager.h @@ -112,7 +112,7 @@ void dm_tm_dec_range(struct dm_transaction_manager *tm, dm_block_t b, dm_block_t */ typedef void (*dm_tm_run_fn)(struct dm_transaction_manager *, dm_block_t, dm_block_t); void dm_tm_with_runs(struct dm_transaction_manager *tm, - const __le64 *value_le, unsigned count, dm_tm_run_fn fn); + const __le64 *value_le, unsigned int count, dm_tm_run_fn fn); int dm_tm_ref(struct dm_transaction_manager *tm, dm_block_t b, uint32_t *result); |