Lines Matching refs:block

36  * block location into the header (paranoia about ssds remapping areas by
93 * Returns a pointer to a value within an array block.
95 * index - The index into _this_ specific block.
109 * 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
194 * Remove some entries from the back of an array block. Every value
215 * Read locks a block, and coerces it to an array block. The caller must
216 * unlock 'block' when finished.
219 struct dm_block **block, struct array_block **ab)
223 r = dm_tm_read_lock(info->btree_info.tm, b, &array_validator, block);
227 *ab = dm_block_data(*block);
232 * Unlocks an array block.
234 static void unlock_ablock(struct dm_array_info *info, struct dm_block *block)
236 dm_tm_unlock(info->btree_info.tm, block);
246 * Looks up an array block in the btree, and then read locks it.
252 unsigned int index, struct dm_block **block,
263 return get_ablock(info, le64_to_cpu(block_le), block, ab);
267 * Insert an array block into the btree. The block is _not_ unlocked.
270 struct dm_block *block, dm_block_t *root)
272 __le64 block_le = cpu_to_le64(dm_block_location(block));
281 struct dm_block **block, struct array_block **ab)
285 &array_validator, block, &inc);
289 *ab = dm_block_data(*block);
301 struct dm_block *block, dm_block_t b,
306 if (dm_block_location(block) != b) {
309 * block, but it is still referenced by the btree. We
314 r = insert_ablock(info, index, block, root);
321 * Looks up an array block in the btree. Then shadows it, and updates the
323 * for both the current root block, and the new one.
326 unsigned int index, struct dm_block **block,
339 r = __shadow_ablock(info, b, block, ab);
343 return __reinsert_ablock(info, index, *block, b, root);
347 * Allocate an new array block, and fill it with some values.
355 struct dm_block *block;
358 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab);
363 r = insert_ablock(info, block_index, block, root);
364 unlock_ablock(info, block);
399 * Metadata block size. Used to calculate the nr entries in an
400 * array block.
405 * Maximum nr entries in an array block.
417 * Number of entries in the final block. 0 iff only full blocks in
430 * in block are decremented as a side effect of the btree remove.
432 * begin_index - the index of the first array block to remove.
433 * end_index - the one-past-the-end value. ie. this block is not removed.
468 struct dm_block *block;
486 * Trim the new tail block
490 resize->new_nr_full_blocks, &block, &ab);
495 unlock_ablock(resize->info, block);
507 struct dm_block *block;
511 resize->old_nr_full_blocks, &block, &ab);
516 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);
735 struct dm_block *block;
748 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab);
756 unlock_ablock(info, block);
760 r = insert_ablock(info, block_index, block, root);
761 unlock_ablock(info, block);
782 struct dm_block *block;
790 r = lookup_ablock(info, root, index / max_entries, &block, &ab);
801 unlock_ablock(info, block);
810 struct dm_block *block;
821 r = shadow_ablock(info, &root, index / max_entries, &block, &ab);
843 unlock_ablock(info, block);
873 struct dm_block *block;
877 r = get_ablock(wi->info, le64_to_cpu(block_le), &block, &ab);
891 unlock_ablock(wi->info, block);
917 if (c->block)
918 unlock_ablock(c->info, c->block);
920 c->block = NULL;
930 r = get_ablock(c->info, le64_to_cpu(value_le), &c->block, &c->ab);
959 if (c->block) {
960 unlock_ablock(c->info, c->block);
970 if (!c->block)