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/zap_micro.c
          +++ new/usr/src/uts/common/fs/zfs/zap_micro.c
↓ open down ↓ 498 lines elided ↑ open up ↑
 499  499          if (zap->zap_ismicro && tx && adding &&
 500  500              zap->zap_m.zap_num_entries == zap->zap_m.zap_num_chunks) {
 501  501                  uint64_t newsz = db->db_size + SPA_MINBLOCKSIZE;
 502  502                  if (newsz > MZAP_MAX_BLKSZ) {
 503  503                          dprintf("upgrading obj %llu: num_entries=%u\n",
 504  504                              obj, zap->zap_m.zap_num_entries);
 505  505                          *zapp = zap;
 506  506                          return (mzap_upgrade(zapp, tx, 0));
 507  507                  }
 508  508                  err = dmu_object_set_blocksize(os, obj, newsz, 0, tx);
 509      -                ASSERT3U(err, ==, 0);
      509 +                ASSERT0(err);
 510  510                  zap->zap_m.zap_num_chunks =
 511  511                      db->db_size / MZAP_ENT_LEN - 1;
 512  512          }
 513  513  
 514  514          *zapp = zap;
 515  515          return (0);
 516  516  }
 517  517  
 518  518  void
 519  519  zap_unlockdir(zap_t *zap)
↓ open down ↓ 74 lines elided ↑ open up ↑
 594  594          zp->mz_block_type = ZBT_MICRO;
 595  595          zp->mz_salt = ((uintptr_t)db ^ (uintptr_t)tx ^ (obj << 1)) | 1ULL;
 596  596          zp->mz_normflags = normflags;
 597  597          dmu_buf_rele(db, FTAG);
 598  598  
 599  599          if (flags != 0) {
 600  600                  zap_t *zap;
 601  601                  /* Only fat zap supports flags; upgrade immediately. */
 602  602                  VERIFY(0 == zap_lockdir(os, obj, tx, RW_WRITER,
 603  603                      B_FALSE, B_FALSE, &zap));
 604      -                VERIFY3U(0, ==, mzap_upgrade(&zap, tx, flags));
      604 +                VERIFY0(mzap_upgrade(&zap, tx, flags));
 605  605                  zap_unlockdir(zap);
 606  606          }
 607  607  }
 608  608  
 609  609  int
 610  610  zap_create_claim(objset_t *os, uint64_t obj, dmu_object_type_t ot,
 611  611      dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx)
 612  612  {
 613  613          return (zap_create_claim_norm(os, obj,
 614  614              0, ot, bonustype, bonuslen, tx));
↓ open down ↓ 842 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX