Lines Matching defs: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 void unlock_ablock(struct dm_array_info *info, struct dm_block *block)
238 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));
283 struct dm_block **block, struct array_block **ab)
287 &array_validator, block, &inc);
291 *ab = dm_block_data(*block);
303 struct dm_block *block, dm_block_t b,
308 if (dm_block_location(block) != b) {
311 * block, but it is still referenced by the btree. We
316 r = insert_ablock(info, index, block, root);
323 * Looks up an array block in the btree. Then shadows it, and updates the
325 * for both the current root block, and the new one.
328 unsigned index, struct dm_block **block,
341 r = __shadow_ablock(info, b, block, ab);
345 return __reinsert_ablock(info, index, *block, b, root);
349 * Allocate an new array block, and fill it with some values.
357 struct dm_block *block;
360 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab);
365 r = insert_ablock(info, block_index, block, root);
366 unlock_ablock(info, block);
401 * Metadata block size. Used to calculate the nr entries in an
402 * array block.
407 * Maximum nr entries in an array block.
419 * Number of entries in the final block. 0 iff only full blocks in
432 * in block are decremented as a side effect of the btree remove.
434 * begin_index - the index of the first array block to remove.
435 * end_index - the one-past-the-end value. ie. this block is not removed.
469 struct dm_block *block;
487 * Trim the new tail block
491 resize->new_nr_full_blocks, &block, &ab);
496 unlock_ablock(resize->info, block);
508 struct dm_block *block;
512 resize->old_nr_full_blocks, &block, &ab);
517 unlock_ablock(resize->info, block);
591 struct dm_block *block;
600 DMERR_LIMIT("couldn't get reference count for block %llu",
610 r = get_ablock(info, b, &block, &ab);
612 DMERR_LIMIT("couldn't get array block %llu",
618 unlock_ablock(info, block);
725 struct dm_block *block;
738 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab);
746 unlock_ablock(info, block);
750 r = insert_ablock(info, block_index, block, root);
751 unlock_ablock(info, block);
772 struct dm_block *block;
780 r = lookup_ablock(info, root, index / max_entries, &block, &ab);
791 unlock_ablock(info, block);
800 struct dm_block *block;
811 r = shadow_ablock(info, &root, index / max_entries, &block, &ab);
833 unlock_ablock(info, block);
863 struct dm_block *block;
867 r = get_ablock(wi->info, le64_to_cpu(block_le), &block, &ab);
881 unlock_ablock(wi->info, block);
907 if (c->block)
908 unlock_ablock(c->info, c->block);
910 c->block = NULL;
920 r = get_ablock(c->info, le64_to_cpu(value_le), &c->block, &c->ab);
949 if (c->block) {
950 unlock_ablock(c->info, c->block);
960 if (!c->block)