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/uts/common/fs/zfs/zap_leaf.c
          +++ new/usr/src/uts/common/fs/zfs/zap_leaf.c
↓ open down ↓ 96 lines elided ↑ open up ↑
  97   97                  return (*(uint64_t *)addr);
  98   98          }
  99   99          ASSERT(!"bad int len");
 100  100          return (0xFEEDFACEDEADBEEFULL);
 101  101  }
 102  102  
 103  103  void
 104  104  zap_leaf_byteswap(zap_leaf_phys_t *buf, int size)
 105  105  {
 106  106          int i;
 107      -        zap_leaf_t l;
      107 +        zap_leaf_t l = { 0 };
      108 +
 108  109          l.l_bs = highbit(size)-1;
 109      -        l.l_phys = buf;
 110  110  
 111  111          buf->l_hdr.lh_block_type =      BSWAP_64(buf->l_hdr.lh_block_type);
 112  112          buf->l_hdr.lh_prefix =          BSWAP_64(buf->l_hdr.lh_prefix);
 113  113          buf->l_hdr.lh_magic =           BSWAP_32(buf->l_hdr.lh_magic);
 114  114          buf->l_hdr.lh_nfree =           BSWAP_16(buf->l_hdr.lh_nfree);
 115  115          buf->l_hdr.lh_nentries =        BSWAP_16(buf->l_hdr.lh_nentries);
 116  116          buf->l_hdr.lh_prefix_len =      BSWAP_16(buf->l_hdr.lh_prefix_len);
 117  117          buf->l_hdr.lh_freelist =        BSWAP_16(buf->l_hdr.lh_freelist);
 118  118  
 119  119          for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(&l); i++)
↓ open down ↓ 705 lines elided ↑ open up ↑
 825  825                  else
 826  826                          (void) zap_leaf_rehash_entry(l, i);
 827  827          }
 828  828  }
 829  829  
 830  830  void
 831  831  zap_leaf_stats(zap_t *zap, zap_leaf_t *l, zap_stats_t *zs)
 832  832  {
 833  833          int i, n;
 834  834  
 835      -        n = zap->zap_f.zap_phys->zap_ptrtbl.zt_shift -
      835 +        n = zap->zap_f_phys->zap_ptrtbl.zt_shift -
 836  836              l->l_phys->l_hdr.lh_prefix_len;
 837  837          n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
 838  838          zs->zs_leafs_with_2n_pointers[n]++;
 839  839  
 840  840  
 841  841          n = l->l_phys->l_hdr.lh_nentries/5;
 842  842          n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
 843  843          zs->zs_blocks_with_n5_entries[n]++;
 844  844  
 845  845          n = ((1<<FZAP_BLOCK_SHIFT(zap)) -
↓ open down ↓ 28 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX