Lines Matching refs:block

35  * block location into the header (paranoia about ssds remapping areas by
92 * Returns a pointer to a value within an array block.
94 * index - The index into _this_ specific block.
108 * in an array block.
120 * Increment every value in an array block.
131 * Decrement every value in an array block.
142 * Each array block can hold this many values.
150 * Allocate a new array block. The caller will need to unlock block.
154 struct dm_block **block, struct array_block **ab)
158 r = dm_tm_new_block(info->btree_info.tm, &array_validator, block);
162 (*ab) = dm_block_data(*block);
171 * Pad an array block out with a particular value. Every instance will
195 * Remove some entries from the back of an array block. Every value
217 * Read locks a block, and coerces it to an array block. The caller must
218 * unlock 'block' when finished.
221 struct dm_block **block, struct array_block **ab)
225 r = dm_tm_read_lock(info->btree_info.tm, b, &array_validator, block);
229 *ab = dm_block_data(*block);
234 * Unlocks an array block.
236 static int unlock_ablock(struct dm_array_info *info, struct dm_block *block)
238 return dm_tm_unlock(info->btree_info.tm, block);
248 * Looks up an array block in the btree, and then read locks it.
254 unsigned index, struct dm_block **block,
265 return get_ablock(info, le64_to_cpu(block_le), block, ab);
269 * Insert an array block into the btree. The block is _not_ unlocked.
272 struct dm_block *block, dm_block_t *root)
274 __le64 block_le = cpu_to_le64(dm_block_location(block));
281 * Looks up an array block in the btree. Then shadows it, and updates the
283 * for both the current root block, and the new one.
286 unsigned index, struct dm_block **block,
306 &array_validator, block, &inc);
310 *ab = dm_block_data(*block);
320 if (dm_block_location(*block) != b) {
323 * block, but it is still referenced by the btree. We
328 r = insert_ablock(info, index, *block, root);
335 * Allocate an new array block, and fill it with some values.
343 struct dm_block *block;
346 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab);
351 r = insert_ablock(info, block_index, block, root);
352 unlock_ablock(info, block);
387 * Metadata block size. Used to calculate the nr entries in an
388 * array block.
393 * Maximum nr entries in an array block.
405 * Number of entries in the final block. 0 iff only full blocks in
418 * in block are decremented as a side effect of the btree remove.
420 * begin_index - the index of the first array block to remove.
421 * end_index - the one-past-the-end value. ie. this block is not removed.
455 struct dm_block *block;
473 * Trim the new tail block
477 resize->new_nr_full_blocks, &block, &ab);
482 unlock_ablock(resize->info, block);
494 struct dm_block *block;
498 resize->old_nr_full_blocks, &block, &ab);
503 unlock_ablock(resize->info, block);
577 struct dm_block *block;
586 DMERR_LIMIT("couldn't get reference count for block %llu",
596 r = get_ablock(info, b, &block, &ab);
598 DMERR_LIMIT("couldn't get array block %llu",
604 unlock_ablock(info, block);
692 struct dm_block *block;
700 r = lookup_ablock(info, root, index / max_entries, &block, &ab);
711 unlock_ablock(info, block);
720 struct dm_block *block;
731 r = shadow_ablock(info, &root, index / max_entries, &block, &ab);
753 unlock_ablock(info, block);
783 struct dm_block *block;
787 r = get_ablock(wi->info, le64_to_cpu(block_le), &block, &ab);
801 unlock_ablock(wi->info, block);