Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/vdev_raidz.c
          +++ new/usr/src/uts/common/fs/zfs/vdev_raidz.c
↓ open down ↓ 273 lines elided ↑ open up ↑
 274  274                  zio_buf_free(rm->rm_datacopy, size);
 275  275  
 276  276          kmem_free(rm, offsetof(raidz_map_t, rm_col[rm->rm_scols]));
 277  277  }
 278  278  
 279  279  static void
 280  280  vdev_raidz_map_free_vsd(zio_t *zio)
 281  281  {
 282  282          raidz_map_t *rm = zio->io_vsd;
 283  283  
 284      -        ASSERT3U(rm->rm_freed, ==, 0);
      284 +        ASSERT0(rm->rm_freed);
 285  285          rm->rm_freed = 1;
 286  286  
 287  287          if (rm->rm_reports == 0)
 288  288                  vdev_raidz_map_free(rm);
 289  289  }
 290  290  
 291  291  /*ARGSUSED*/
 292  292  static void
 293  293  vdev_raidz_cksum_free(void *arg, size_t ignored)
 294  294  {
↓ open down ↓ 832 lines elided ↑ open up ↑
1127 1127                          rows[i][jj] = 0;
1128 1128                  }
1129 1129          }
1130 1130  
1131 1131          /*
1132 1132           * For each of the rows of interest, we must normalize it and subtract
1133 1133           * a multiple of it from the other rows.
1134 1134           */
1135 1135          for (i = 0; i < nmissing; i++) {
1136 1136                  for (j = 0; j < missing[i]; j++) {
1137      -                        ASSERT3U(rows[i][j], ==, 0);
     1137 +                        ASSERT0(rows[i][j]);
1138 1138                  }
1139 1139                  ASSERT3U(rows[i][missing[i]], !=, 0);
1140 1140  
1141 1141                  /*
1142 1142                   * Compute the inverse of the first element and multiply each
1143 1143                   * element in the row by that value.
1144 1144                   */
1145 1145                  log = 255 - vdev_raidz_log2[rows[i][missing[i]]];
1146 1146  
1147 1147                  for (j = 0; j < n; j++) {
↓ open down ↓ 20 lines elided ↑ open up ↑
1168 1168  
1169 1169          /*
1170 1170           * Verify that the data that is left in the rows are properly part of
1171 1171           * an identity matrix.
1172 1172           */
1173 1173          for (i = 0; i < nmissing; i++) {
1174 1174                  for (j = 0; j < n; j++) {
1175 1175                          if (j == missing[i]) {
1176 1176                                  ASSERT3U(rows[i][j], ==, 1);
1177 1177                          } else {
1178      -                                ASSERT3U(rows[i][j], ==, 0);
     1178 +                                ASSERT0(rows[i][j]);
1179 1179                          }
1180 1180                  }
1181 1181          }
1182 1182  }
1183 1183  
1184 1184  static void
1185 1185  vdev_raidz_matrix_reconstruct(raidz_map_t *rm, int n, int nmissing,
1186 1186      int *missing, uint8_t **invrows, const uint8_t *used)
1187 1187  {
1188 1188          int i, j, x, cc, c;
↓ open down ↓ 962 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX