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/dmu_objset.c
          +++ new/usr/src/uts/common/fs/zfs/dmu_objset.c
↓ open down ↓ 700 lines elided ↑ open up ↑
 701  701          struct oscarg *oa = arg2;
 702  702          uint64_t obj;
 703  703          dsl_dataset_t *ds;
 704  704          blkptr_t *bp;
 705  705  
 706  706          ASSERT(dmu_tx_is_syncing(tx));
 707  707  
 708  708          obj = dsl_dataset_create_sync(dd, oa->lastname,
 709  709              oa->clone_origin, oa->flags, oa->cr, tx);
 710  710  
 711      -        VERIFY3U(0, ==, dsl_dataset_hold_obj(dd->dd_pool, obj, FTAG, &ds));
      711 +        VERIFY0(dsl_dataset_hold_obj(dd->dd_pool, obj, FTAG, &ds));
 712  712          bp = dsl_dataset_get_blkptr(ds);
 713  713          if (BP_IS_HOLE(bp)) {
 714  714                  objset_t *os =
 715  715                      dmu_objset_create_impl(spa, ds, bp, oa->type, tx);
 716  716  
 717  717                  if (oa->userfunc)
 718  718                          oa->userfunc(os, oa->userarg, oa->cr, tx);
 719  719          }
 720  720  
 721  721          if (oa->clone_origin == NULL) {
↓ open down ↓ 444 lines elided ↑ open up ↑
1166 1166                   */
1167 1167                  os->os_copies = spa_max_replication(os->os_spa);
1168 1168          }
1169 1169  
1170 1170          /*
1171 1171           * Create the root block IO
1172 1172           */
1173 1173          SET_BOOKMARK(&zb, os->os_dsl_dataset ?
1174 1174              os->os_dsl_dataset->ds_object : DMU_META_OBJSET,
1175 1175              ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
1176      -        VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf,
     1176 +        VERIFY0(arc_release_bp(os->os_phys_buf, &os->os_phys_buf,
1177 1177              os->os_rootbp, os->os_spa, &zb));
1178 1178  
1179 1179          dmu_write_policy(os, NULL, 0, 0, &zp);
1180 1180  
1181 1181          zio = arc_write(pio, os->os_spa, tx->tx_txg,
1182 1182              os->os_rootbp, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os), &zp,
1183 1183              dmu_objset_write_ready, dmu_objset_write_done, os,
1184 1184              ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb);
1185 1185  
1186 1186          /*
↓ open down ↓ 75 lines elided ↑ open up ↑
1262 1262  }
1263 1263  
1264 1264  static void
1265 1265  do_userquota_update(objset_t *os, uint64_t used, uint64_t flags,
1266 1266      uint64_t user, uint64_t group, boolean_t subtract, dmu_tx_t *tx)
1267 1267  {
1268 1268          if ((flags & DNODE_FLAG_USERUSED_ACCOUNTED)) {
1269 1269                  int64_t delta = DNODE_SIZE + used;
1270 1270                  if (subtract)
1271 1271                          delta = -delta;
1272      -                VERIFY3U(0, ==, zap_increment_int(os, DMU_USERUSED_OBJECT,
     1272 +                VERIFY0(zap_increment_int(os, DMU_USERUSED_OBJECT,
1273 1273                      user, delta, tx));
1274      -                VERIFY3U(0, ==, zap_increment_int(os, DMU_GROUPUSED_OBJECT,
     1274 +                VERIFY0(zap_increment_int(os, DMU_GROUPUSED_OBJECT,
1275 1275                      group, delta, tx));
1276 1276          }
1277 1277  }
1278 1278  
1279 1279  void
1280 1280  dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx)
1281 1281  {
1282 1282          dnode_t *dn;
1283 1283          list_t *list = &os->os_synced_dnodes;
1284 1284  
↓ open down ↓ 566 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX