zap.c (239774) | zap.c (240415) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 148 unchanged lines hidden (view full) --- 157 ASSERT(tbl->zt_blk != 0); 158 ASSERT(tbl->zt_numblks > 0); 159 160 if (tbl->zt_nextblk != 0) { 161 newblk = tbl->zt_nextblk; 162 } else { 163 newblk = zap_allocate_blocks(zap, tbl->zt_numblks * 2); 164 tbl->zt_nextblk = newblk; | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 148 unchanged lines hidden (view full) --- 157 ASSERT(tbl->zt_blk != 0); 158 ASSERT(tbl->zt_numblks > 0); 159 160 if (tbl->zt_nextblk != 0) { 161 newblk = tbl->zt_nextblk; 162 } else { 163 newblk = zap_allocate_blocks(zap, tbl->zt_numblks * 2); 164 tbl->zt_nextblk = newblk; |
165 ASSERT3U(tbl->zt_blks_copied, ==, 0); | 165 ASSERT0(tbl->zt_blks_copied); |
166 dmu_prefetch(zap->zap_objset, zap->zap_object, 167 tbl->zt_blk << bs, tbl->zt_numblks << bs); 168 } 169 170 /* 171 * Copy the ptrtbl from the old to new location. 172 */ 173 --- 160 unchanged lines hidden (view full) --- 334 * block, which will double the size of the ptrtbl. 335 */ 336 uint64_t newblk; 337 dmu_buf_t *db_new; 338 int err; 339 340 ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_shift, ==, 341 ZAP_EMBEDDED_PTRTBL_SHIFT(zap)); | 166 dmu_prefetch(zap->zap_objset, zap->zap_object, 167 tbl->zt_blk << bs, tbl->zt_numblks << bs); 168 } 169 170 /* 171 * Copy the ptrtbl from the old to new location. 172 */ 173 --- 160 unchanged lines hidden (view full) --- 334 * block, which will double the size of the ptrtbl. 335 */ 336 uint64_t newblk; 337 dmu_buf_t *db_new; 338 int err; 339 340 ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_shift, ==, 341 ZAP_EMBEDDED_PTRTBL_SHIFT(zap)); |
342 ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_blk, ==, 0); | 342 ASSERT0(zap->zap_f.zap_phys->zap_ptrtbl.zt_blk); |
343 344 newblk = zap_allocate_blocks(zap, 1); 345 err = dmu_buf_hold(zap->zap_objset, zap->zap_object, 346 newblk << FZAP_BLOCK_SHIFT(zap), FTAG, &db_new, 347 DMU_READ_NO_PREFETCH); 348 if (err) 349 return (err); 350 dmu_buf_will_dirty(db_new, tx); --- 119 unchanged lines hidden (view full) --- 470 l = winner; 471 } 472 473 /* 474 * lhr_pad was previously used for the next leaf in the leaf 475 * chain. There should be no chained leafs (as we have removed 476 * support for them). 477 */ | 343 344 newblk = zap_allocate_blocks(zap, 1); 345 err = dmu_buf_hold(zap->zap_objset, zap->zap_object, 346 newblk << FZAP_BLOCK_SHIFT(zap), FTAG, &db_new, 347 DMU_READ_NO_PREFETCH); 348 if (err) 349 return (err); 350 dmu_buf_will_dirty(db_new, tx); --- 119 unchanged lines hidden (view full) --- 470 l = winner; 471 } 472 473 /* 474 * lhr_pad was previously used for the next leaf in the leaf 475 * chain. There should be no chained leafs (as we have removed 476 * support for them). 477 */ |
478 ASSERT3U(l->l_phys->l_hdr.lh_pad1, ==, 0); | 478 ASSERT0(l->l_phys->l_hdr.lh_pad1); |
479 480 /* 481 * There should be more hash entries than there can be 482 * chunks to put in the hash table 483 */ 484 ASSERT3U(ZAP_LEAF_HASH_NUMENTRIES(l), >, ZAP_LEAF_NUMCHUNKS(l) / 3); 485 486 /* The chunks should begin at the end of the hash table */ --- 166 unchanged lines hidden (view full) --- 653 return (err); 654 ASSERT3U(blk, ==, l->l_blkid); 655 } 656 657 nl = zap_create_leaf(zap, tx); 658 zap_leaf_split(l, nl, zap->zap_normflags != 0); 659 660 /* set sibling pointers */ | 479 480 /* 481 * There should be more hash entries than there can be 482 * chunks to put in the hash table 483 */ 484 ASSERT3U(ZAP_LEAF_HASH_NUMENTRIES(l), >, ZAP_LEAF_NUMCHUNKS(l) / 3); 485 486 /* The chunks should begin at the end of the hash table */ --- 166 unchanged lines hidden (view full) --- 653 return (err); 654 ASSERT3U(blk, ==, l->l_blkid); 655 } 656 657 nl = zap_create_leaf(zap, tx); 658 zap_leaf_split(l, nl, zap->zap_normflags != 0); 659 660 /* set sibling pointers */ |
661 for (i = 0; i < (1ULL<<prefix_diff); i++) { | 661 for (i = 0; i < (1ULL << prefix_diff); i++) { |
662 err = zap_set_idx_to_blk(zap, sibling+i, nl->l_blkid, tx); | 662 err = zap_set_idx_to_blk(zap, sibling+i, nl->l_blkid, tx); |
663 ASSERT3U(err, ==, 0); /* we checked for i/o errors above */ | 663 ASSERT0(err); /* we checked for i/o errors above */ |
664 } 665 666 if (hash & (1ULL << (64 - l->l_phys->l_hdr.lh_prefix_len))) { 667 /* we want the sibling */ 668 zap_put_leaf(l); 669 *lp = nl; 670 } else { 671 zap_put_leaf(nl); --- 707 unchanged lines hidden --- | 664 } 665 666 if (hash & (1ULL << (64 - l->l_phys->l_hdr.lh_prefix_len))) { 667 /* we want the sibling */ 668 zap_put_leaf(l); 669 *lp = nl; 670 } else { 671 zap_put_leaf(nl); --- 707 unchanged lines hidden --- |