Print this page
3752 want more verifiable dbuf user eviction
Submitted by:   Justin Gibbs <justing@spectralogic.com>
Submitted by:   Will Andrews <willa@spectralogic.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/zfs/zfs.c
          +++ new/usr/src/cmd/mdb/common/modules/zfs/zfs.c
↓ open down ↓ 513 lines elided ↑ open up ↑
 514  514   *
 515  515   * Print a zap_leaf_phys_t, assumed to be 16k
 516  516   */
 517  517  /* ARGSUSED */
 518  518  static int
 519  519  zap_leaf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 520  520  {
 521  521          char buf[16*1024];
 522  522          int verbose = B_FALSE;
 523  523          int four = B_FALSE;
 524      -        zap_leaf_t l;
      524 +        zap_leaf_t l = { 0 };
 525  525          zap_leaf_phys_t *zlp = (void *)buf;
 526  526          int i;
 527  527  
 528  528          if (mdb_getopts(argc, argv,
 529  529              'v', MDB_OPT_SETBITS, TRUE, &verbose,
 530  530              '4', MDB_OPT_SETBITS, TRUE, &four,
 531  531              NULL) != argc)
 532  532                  return (DCMD_USAGE);
 533  533  
 534  534          l.l_phys = zlp;
↓ open down ↓ 883 lines elided ↑ open up ↑
1418 1418          wsp->walk_data = mw;
1419 1419  
1420 1420          return (WALK_NEXT);
1421 1421  }
1422 1422  
1423 1423  typedef struct mdb_spa {
1424 1424          uintptr_t spa_dsl_pool;
1425 1425          uintptr_t spa_root_vdev;
1426 1426  } mdb_spa_t;
1427 1427  
     1428 +struct mdb_dsl_dir_phys;
     1429 +typedef struct mdb_dsl_dir_dbuf {
     1430 +        uint8_t dddb_pad[offsetof(dmu_buf_t, db_data)];
     1431 +        uintptr_t dddb_data;
     1432 +} mdb_dsl_dir_dbuf_t;
     1433 +
1428 1434  typedef struct mdb_dsl_dir {
1429      -        uintptr_t dd_phys;
     1435 +        union {
     1436 +                dmu_buf_t *dd_dmu_db;
     1437 +                mdb_dsl_dir_dbuf_t *dd_db;
     1438 +        } dd_db_u;
1430 1439          int64_t dd_space_towrite[TXG_SIZE];
1431 1440  } mdb_dsl_dir_t;
1432 1441  
1433 1442  typedef struct mdb_dsl_dir_phys {
1434 1443          uint64_t dd_used_bytes;
1435 1444          uint64_t dd_compressed_bytes;
1436 1445          uint64_t dd_uncompressed_bytes;
1437 1446  } mdb_dsl_dir_phys_t;
1438 1447  
1439 1448  typedef struct mdb_vdev {
↓ open down ↓ 1718 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX