Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>

*** 84,105 **** #ifdef __cplusplus extern "C" { #endif /* ! * The matchtype specifies which entry will be accessed. ! * MT_EXACT: only find an exact match (non-normalized) ! * MT_FIRST: find the "first" normalized (case and Unicode ! * form) match; the designated "first" match will not change as long ! * as the set of entries with this normalization doesn't change ! * MT_BEST: if there is an exact match, find that, otherwise find the ! * first normalized match */ typedef enum matchtype { MT_EXACT, MT_BEST, MT_FIRST } matchtype_t; typedef enum zap_flags { /* Use 64-bit hash value (serialized cursors will always use 64-bits) */ --- 84,109 ---- #ifdef __cplusplus extern "C" { #endif /* ! * Specifies matching criteria for ZAP lookups. */ typedef enum matchtype { + /* Only find an exact match (non-normalized) */ MT_EXACT, + /* + * If there is an exact match, find that, otherwise find the + * first normalized match. + */ MT_BEST, + /* + * Find the "first" normalized (case and Unicode form) match; + * the designated "first" match will not change as long as the + * set of entries with this normalization doesn't change. + */ MT_FIRST } matchtype_t; typedef enum zap_flags { /* Use 64-bit hash value (serialized cursors will always use 64-bits) */
*** 172,200 **** * * If 'integer_size' is smaller than the attribute's integer size, the * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer ! * size, the call will succeed and return 0. * When converting to a ! * larger integer size, the integers will be treated as unsigned (ie. no ! * sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. ! * * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). * * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ - int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, - uint64_t integer_size, uint64_t num_integers, void *buf); int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, boolean_t *normalization_conflictp); int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key, --- 176,207 ---- * * If 'integer_size' is smaller than the attribute's integer size, the * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer ! * size, the call will succeed and return 0. ! * ! * When converting to a larger integer size, the integers will be treated as ! * unsigned (ie. no sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. ! */ ! int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, ! uint64_t integer_size, uint64_t num_integers, void *buf); ! ! /* * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). * * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, boolean_t *normalization_conflictp); int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,