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/cmd/zhack/zhack.c
          +++ new/usr/src/cmd/zhack/zhack.c
↓ open down ↓ 336 lines elided ↑ open up ↑
 337  337                  fatal("invalid feature guid: %s", feature.fi_guid);
 338  338  
 339  339          zhack_spa_open(target, B_FALSE, FTAG, &spa);
 340  340          mos = spa->spa_meta_objset;
 341  341  
 342  342          if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
 343  343                  fatal("'%s' is a real feature, will not enable");
 344  344          if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
 345  345                  fatal("feature already enabled: %s", feature.fi_guid);
 346  346  
 347      -        VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
      347 +        VERIFY0(dsl_sync_task_do(spa->spa_dsl_pool, NULL,
 348  348              feature_enable_sync, spa, &feature, 5));
 349  349  
 350  350          spa_close(spa, FTAG);
 351  351  
 352  352          free(desc);
 353  353  }
 354  354  
 355  355  static void
 356  356  feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
 357  357  {
↓ open down ↓ 77 lines elided ↑ open up ↑
 435  435          } else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj,
 436  436              feature.fi_guid)) {
 437  437                  feature.fi_can_readonly = B_TRUE;
 438  438          } else {
 439  439                  fatal("feature is not enabled: %s", feature.fi_guid);
 440  440          }
 441  441  
 442  442          if (decr && !spa_feature_is_active(spa, &feature))
 443  443                  fatal("feature refcount already 0: %s", feature.fi_guid);
 444  444  
 445      -        VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
      445 +        VERIFY0(dsl_sync_task_do(spa->spa_dsl_pool, NULL,
 446  446              decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));
 447  447  
 448  448          spa_close(spa, FTAG);
 449  449  }
 450  450  
 451  451  static int
 452  452  zhack_do_feature(int argc, char **argv)
 453  453  {
 454  454          char *subcommand;
 455  455  
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX