Lines Matching +full:indexed +full:- +full:array
1 /* SPDX-License-Identifier: GPL-2.0-only */
10 #include "dm-btree.h"
12 /*----------------------------------------------------------------*/
15 * The dm-array is a persistent version of an array. It packs the data
26 * size along with the array root in your encompassing data.
28 * Array entries are indexed via an unsigned integer starting from zero.
29 * Arrays are not sparse; if you resize an array to have 'n' entries then
30 * 'n - 1' will be the last valid index.
34 * a) initialise a dm_array_info structure. This describes the array
40 * disk that holds a particular instance of an array. You may have a
42 * want to create a brand new, empty array with dm_array_empty().
46 * root for a _new_ array. If you've incremented the old root, via
50 * c) resize an array with dm_array_resize().
52 * d) Get a value from the array with dm_array_get_value().
54 * e) Set a value in the array with dm_array_set_value().
56 * f) Walk an array of values in index order with dm_array_walk(). More
59 * g) Destroy the array with dm_array_del(). This tells the transaction
66 * Describes an array. Don't initialise this structure yourself, use the
79 * info - the structure being filled in.
80 * tm - the transaction manager that should supervise this structure.
81 * vt - describes the leaf values.
88 * Create an empty, zero length array.
90 * info - describes the array
91 * root - on success this will be filled out with the root block
96 * Resizes the array.
98 * info - describes the array
99 * root - the root block of the array on disk
100 * old_size - the caller is responsible for remembering the size of
101 * the array
102 * new_size - can be bigger or smaller than old_size
103 * value - if we're growing the array the new entries will have this value
104 * new_root - on success, points to the new root block
116 * Creates a new array populated with values provided by a callback
117 * function. This is more efficient than creating an empty array,
122 * array.
124 * info - describes the array
125 * root - the root block of the array on disk
126 * size - the number of entries in the array
127 * fn - the callback
128 * context - passed to the callback
135 * Frees a whole array. The value_type's decrement operation will be called
136 * for all values in the array
141 * Lookup a value in the array
143 * info - describes the array
144 * root - root block of the array
145 * index - array index
146 * value - the value to be read. Will be in on-disk format of course.
148 * -ENODATA will be returned if the index is out of bounds.
154 * Set an entry in the array.
156 * info - describes the array
157 * root - root block of the array
158 * index - array index
159 * value - value to be written to disk. Make sure you confirm the value is
160 * in on-disk format with__dm_bless_for_disk() before calling.
161 * new_root - the new root block
166 * -ENODATA will be returned if the index is out of bounds.
173 * Walk through all the entries in an array.
175 * info - describes the array
176 * root - root block of the array
177 * fn - called back for every element
178 * context - passed to the callback
184 /*----------------------------------------------------------------*/
189 * This lets you iterate through all the entries in an array efficiently
218 /*----------------------------------------------------------------*/