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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/zap.h
          +++ new/usr/src/uts/common/fs/zfs/sys/zap.h
↓ open down ↓ 78 lines elided ↑ open up ↑
  79   79   * we'll have to add routines for using length-bounded strings.
  80   80   */
  81   81  
  82   82  #include <sys/dmu.h>
  83   83  
  84   84  #ifdef  __cplusplus
  85   85  extern "C" {
  86   86  #endif
  87   87  
  88   88  /*
  89      - * The matchtype specifies which entry will be accessed.
  90      - * MT_EXACT: only find an exact match (non-normalized)
  91      - * MT_FIRST: find the "first" normalized (case and Unicode
  92      - *     form) match; the designated "first" match will not change as long
  93      - *     as the set of entries with this normalization doesn't change
  94      - * MT_BEST: if there is an exact match, find that, otherwise find the
  95      - *     first normalized match
       89 + * Specifies matching criteria for ZAP lookups.
  96   90   */
  97   91  typedef enum matchtype
  98   92  {
       93 +        /* Only find an exact match (non-normalized) */
  99   94          MT_EXACT,
       95 +        /*
       96 +         * If there is an exact match, find that, otherwise find the
       97 +         * first normalized match.
       98 +         */
 100   99          MT_BEST,
      100 +        /*
      101 +         * Find the "first" normalized (case and Unicode form) match;
      102 +         * the designated "first" match will not change as long as the
      103 +         * set of entries with this normalization doesn't change.
      104 +         */
 101  105          MT_FIRST
 102  106  } matchtype_t;
 103  107  
 104  108  typedef enum zap_flags {
 105  109          /* Use 64-bit hash value (serialized cursors will always use 64-bits) */
 106  110          ZAP_FLAG_HASH64 = 1 << 0,
 107  111          /* Key is binary, not string (zap_add_uint64() can be used) */
 108  112          ZAP_FLAG_UINT64_KEY = 1 << 1,
 109  113          /*
 110  114           * First word of key (which must be an array of uint64) is
↓ open down ↓ 56 lines elided ↑ open up ↑
 167  171  /*
 168  172   * Retrieve the contents of the attribute with the given name.
 169  173   *
 170  174   * If the requested attribute does not exist, the call will fail and
 171  175   * return ENOENT.
 172  176   *
 173  177   * If 'integer_size' is smaller than the attribute's integer size, the
 174  178   * call will fail and return EINVAL.
 175  179   *
 176  180   * If 'integer_size' is equal to or larger than the attribute's integer
 177      - * size, the call will succeed and return 0.  * When converting to a
 178      - * larger integer size, the integers will be treated as unsigned (ie. no
 179      - * sign-extension will be performed).
      181 + * size, the call will succeed and return 0.
      182 + *
      183 + * When converting to a larger integer size, the integers will be treated as
      184 + * unsigned (ie. no sign-extension will be performed).
 180  185   *
 181  186   * 'num_integers' is the length (in integers) of 'buf'.
 182  187   *
 183  188   * If the attribute is longer than the buffer, as many integers as will
 184  189   * fit will be transferred to 'buf'.  If the entire attribute was not
 185  190   * transferred, the call will return EOVERFLOW.
 186      - *
      191 + */
      192 +int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name,
      193 +    uint64_t integer_size, uint64_t num_integers, void *buf);
      194 +
      195 +/*
 187  196   * If rn_len is nonzero, realname will be set to the name of the found
 188  197   * entry (which may be different from the requested name if matchtype is
 189  198   * not MT_EXACT).
 190  199   *
 191  200   * If normalization_conflictp is not NULL, it will be set if there is
 192  201   * another name with the same case/unicode normalized form.
 193  202   */
 194      -int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name,
 195      -    uint64_t integer_size, uint64_t num_integers, void *buf);
 196  203  int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
 197  204      uint64_t integer_size, uint64_t num_integers, void *buf,
 198  205      matchtype_t mt, char *realname, int rn_len,
 199  206      boolean_t *normalization_conflictp);
 200  207  int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
 201  208      int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
 202  209  int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
 203  210  int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
 204  211      int key_numints);
 205  212  
↓ open down ↓ 276 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX