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/sa_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/sa_impl.h
↓ open down ↓ 142 lines elided ↑ open up ↑
 143  143          sa_attr_table_t *sa_attr_table;  /* private attr table */
 144  144          sa_update_cb_t  *sa_update_cb;
 145  145          avl_tree_t      sa_layout_num_tree;  /* keyed by layout number */
 146  146          avl_tree_t      sa_layout_hash_tree; /* keyed by layout hash value */
 147  147          int             sa_user_table_sz;
 148  148          sa_attr_type_t  *sa_user_table; /* user name->attr mapping table */
 149  149  };
 150  150  
 151  151  /*
 152  152   * header for all bonus and spill buffers.
      153 + *
 153  154   * The header has a fixed portion with a variable number
 154  155   * of "lengths" depending on the number of variable sized
 155  156   * attribues which are determined by the "layout number"
 156  157   */
 157  158  
 158  159  #define SA_MAGIC        0x2F505A  /* ZFS SA */
 159  160  typedef struct sa_hdr_phys {
 160  161          uint32_t sa_magic;
 161      -        uint16_t sa_layout_info;  /* Encoded with hdrsize and layout number */
      162 +        /*
      163 +         * Encoded with hdrsize and layout number as follows:
      164 +         * 16      10       0
      165 +         * +--------+-------+
      166 +         * | hdrsz  |layout |
      167 +         * +--------+-------+
      168 +         *
      169 +         * Bits 0-10 are the layout number
      170 +         * Bits 11-16 are the size of the header.
      171 +         * The hdrsize is the number * 8
      172 +         *
      173 +         * For example.
      174 +         * hdrsz of 1 ==> 8 byte header
      175 +         *          2 ==> 16 byte header
      176 +         *
      177 +         */
      178 +        uint16_t sa_layout_info;
 162  179          uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */
 163  180          /* ... Data follows the lengths.  */
 164  181  } sa_hdr_phys_t;
 165  182  
 166      -/*
 167      - * sa_hdr_phys -> sa_layout_info
 168      - *
 169      - * 16      10       0
 170      - * +--------+-------+
 171      - * | hdrsz  |layout |
 172      - * +--------+-------+
 173      - *
 174      - * Bits 0-10 are the layout number
 175      - * Bits 11-16 are the size of the header.
 176      - * The hdrsize is the number * 8
 177      - *
 178      - * For example.
 179      - * hdrsz of 1 ==> 8 byte header
 180      - *          2 ==> 16 byte header
 181      - *
 182      - */
 183      -
 184  183  #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10)
 185  184  #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0)
 186  185  #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \
 187  186  { \
 188  187          BF32_SET_SB(x, 10, 6, 3, 0, size); \
 189  188          BF32_SET(x, 0, 10, num); \
 190  189  }
 191  190  
 192  191  typedef enum sa_buf_type {
 193  192          SA_BONUS = 1,
↓ open down ↓ 95 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX