191 *
192 * If normalization_conflictp is not NULL, it will be set if there is
193 * another name with the same case/unicode normalized form.
194 */
195 int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
196 uint64_t integer_size, uint64_t num_integers, void *buf,
197 matchtype_t mt, char *realname, int rn_len,
198 boolean_t *normalization_conflictp);
199 int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
200 int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
201 int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
202 int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
203 int key_numints);
204 int zap_lookup_by_dnode(dnode_t *dn, const char *name,
205 uint64_t integer_size, uint64_t num_integers, void *buf);
206 int zap_lookup_norm_by_dnode(dnode_t *dn, const char *name,
207 uint64_t integer_size, uint64_t num_integers, void *buf,
208 matchtype_t mt, char *realname, int rn_len,
209 boolean_t *ncp);
210
211 int zap_count_write_by_dnode(dnode_t *dn, const char *name,
212 int add, refcount_t *towrite, refcount_t *tooverwrite);
213
214 /*
215 * Create an attribute with the given name and value.
216 *
217 * If an attribute with the given name already exists, the call will
218 * fail and return EEXIST.
219 */
220 int zap_add(objset_t *ds, uint64_t zapobj, const char *key,
221 int integer_size, uint64_t num_integers,
222 const void *val, dmu_tx_t *tx);
223 int zap_add_by_dnode(dnode_t *dn, const char *key,
224 int integer_size, uint64_t num_integers,
225 const void *val, dmu_tx_t *tx);
226 int zap_add_uint64(objset_t *ds, uint64_t zapobj, const uint64_t *key,
227 int key_numints, int integer_size, uint64_t num_integers,
228 const void *val, dmu_tx_t *tx);
229
230 /*
231 * Set the attribute with the given name to the given value. If an
232 * attribute with the given name does not exist, it will be created. If
233 * an attribute with the given name already exists, the previous value
273 int zap_count(objset_t *ds, uint64_t zapobj, uint64_t *count);
274
275 /*
276 * Returns (in name) the name of the entry whose (value & mask)
277 * (za_first_integer) is value, or ENOENT if not found. The string
278 * pointed to by name must be at least 256 bytes long. If mask==0, the
279 * match must be exact (ie, same as mask=-1ULL).
280 */
281 int zap_value_search(objset_t *os, uint64_t zapobj,
282 uint64_t value, uint64_t mask, char *name);
283
284 /*
285 * Transfer all the entries from fromobj into intoobj. Only works on
286 * int_size=8 num_integers=1 values. Fails if there are any duplicated
287 * entries.
288 */
289 int zap_join(objset_t *os, uint64_t fromobj, uint64_t intoobj, dmu_tx_t *tx);
290
291 /* Same as zap_join, but set the values to 'value'. */
292 int zap_join_key(objset_t *os, uint64_t fromobj, uint64_t intoobj,
293 uint64_t value, dmu_tx_t *tx);
294
295 /* Same as zap_join, but add together any duplicated entries. */
296 int zap_join_increment(objset_t *os, uint64_t fromobj, uint64_t intoobj,
297 dmu_tx_t *tx);
298
299 /*
300 * Manipulate entries where the name + value are the "same" (the name is
301 * a stringified version of the value).
302 */
303 int zap_add_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
304 int zap_remove_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
305 int zap_lookup_int(objset_t *os, uint64_t obj, uint64_t value);
306 int zap_increment_int(objset_t *os, uint64_t obj, uint64_t key, int64_t delta,
307 dmu_tx_t *tx);
308
309 /* Here the key is an int and the value is a different int. */
310 int zap_add_int_key(objset_t *os, uint64_t obj,
311 uint64_t key, uint64_t value, dmu_tx_t *tx);
312 int zap_update_int_key(objset_t *os, uint64_t obj,
313 uint64_t key, uint64_t value, dmu_tx_t *tx);
|
191 *
192 * If normalization_conflictp is not NULL, it will be set if there is
193 * another name with the same case/unicode normalized form.
194 */
195 int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
196 uint64_t integer_size, uint64_t num_integers, void *buf,
197 matchtype_t mt, char *realname, int rn_len,
198 boolean_t *normalization_conflictp);
199 int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
200 int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
201 int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
202 int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
203 int key_numints);
204 int zap_lookup_by_dnode(dnode_t *dn, const char *name,
205 uint64_t integer_size, uint64_t num_integers, void *buf);
206 int zap_lookup_norm_by_dnode(dnode_t *dn, const char *name,
207 uint64_t integer_size, uint64_t num_integers, void *buf,
208 matchtype_t mt, char *realname, int rn_len,
209 boolean_t *ncp);
210
211 /*
212 * Create an attribute with the given name and value.
213 *
214 * If an attribute with the given name already exists, the call will
215 * fail and return EEXIST.
216 */
217 int zap_add(objset_t *ds, uint64_t zapobj, const char *key,
218 int integer_size, uint64_t num_integers,
219 const void *val, dmu_tx_t *tx);
220 int zap_add_by_dnode(dnode_t *dn, const char *key,
221 int integer_size, uint64_t num_integers,
222 const void *val, dmu_tx_t *tx);
223 int zap_add_uint64(objset_t *ds, uint64_t zapobj, const uint64_t *key,
224 int key_numints, int integer_size, uint64_t num_integers,
225 const void *val, dmu_tx_t *tx);
226
227 /*
228 * Set the attribute with the given name to the given value. If an
229 * attribute with the given name does not exist, it will be created. If
230 * an attribute with the given name already exists, the previous value
270 int zap_count(objset_t *ds, uint64_t zapobj, uint64_t *count);
271
272 /*
273 * Returns (in name) the name of the entry whose (value & mask)
274 * (za_first_integer) is value, or ENOENT if not found. The string
275 * pointed to by name must be at least 256 bytes long. If mask==0, the
276 * match must be exact (ie, same as mask=-1ULL).
277 */
278 int zap_value_search(objset_t *os, uint64_t zapobj,
279 uint64_t value, uint64_t mask, char *name);
280
281 /*
282 * Transfer all the entries from fromobj into intoobj. Only works on
283 * int_size=8 num_integers=1 values. Fails if there are any duplicated
284 * entries.
285 */
286 int zap_join(objset_t *os, uint64_t fromobj, uint64_t intoobj, dmu_tx_t *tx);
287
288 /* Same as zap_join, but set the values to 'value'. */
289 int zap_join_key(objset_t *os, uint64_t fromobj, uint64_t intoobj,
290 uint64_t value, dmu_tx_t *tx, boolean_t exists_ok);
291
292 /* Same as zap_join, but add together any duplicated entries. */
293 int zap_join_increment(objset_t *os, uint64_t fromobj, uint64_t intoobj,
294 dmu_tx_t *tx);
295
296 /*
297 * Manipulate entries where the name + value are the "same" (the name is
298 * a stringified version of the value).
299 */
300 int zap_add_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
301 int zap_remove_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
302 int zap_lookup_int(objset_t *os, uint64_t obj, uint64_t value);
303 int zap_increment_int(objset_t *os, uint64_t obj, uint64_t key, int64_t delta,
304 dmu_tx_t *tx);
305
306 /* Here the key is an int and the value is a different int. */
307 int zap_add_int_key(objset_t *os, uint64_t obj,
308 uint64_t key, uint64_t value, dmu_tx_t *tx);
309 int zap_update_int_key(objset_t *os, uint64_t obj,
310 uint64_t key, uint64_t value, dmu_tx_t *tx);
|