Print this page
4171 clean up spa_feature_*() interfaces
4172 implement extensible_dataset feature for use by other zpool features
Reviewed by: Max Grossman <max.grossman@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dnode_sync.c
          +++ new/usr/src/uts/common/fs/zfs/dnode_sync.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2012 by Delphix. All rights reserved.
       24 + * Copyright (c) 2013 by Delphix. All rights reserved.
  25   25   */
  26   26  
  27   27  #include <sys/zfs_context.h>
  28   28  #include <sys/dbuf.h>
  29   29  #include <sys/dnode.h>
  30   30  #include <sys/dmu.h>
  31   31  #include <sys/dmu_tx.h>
  32   32  #include <sys/dmu_objset.h>
  33   33  #include <sys/dsl_dataset.h>
  34   34  #include <sys/spa.h>
↓ open down ↓ 532 lines elided ↑ open up ↑
 567  567                  dnp->dn_type = dn->dn_type;
 568  568                  dnp->dn_bonustype = dn->dn_bonustype;
 569  569                  dnp->dn_bonuslen = dn->dn_bonuslen;
 570  570          }
 571  571  
 572  572          ASSERT(dnp->dn_nlevels > 1 ||
 573  573              BP_IS_HOLE(&dnp->dn_blkptr[0]) ||
 574  574              BP_GET_LSIZE(&dnp->dn_blkptr[0]) ==
 575  575              dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT);
 576  576  
 577      -        if (dn->dn_next_blksz[txgoff]) {
      577 +        if (dn->dn_next_type[txgoff] != 0) {
      578 +                dnp->dn_type = dn->dn_type;
      579 +                dn->dn_next_type[txgoff] = 0;
      580 +        }
      581 +
      582 +        if (dn->dn_next_blksz[txgoff] != 0) {
 578  583                  ASSERT(P2PHASE(dn->dn_next_blksz[txgoff],
 579  584                      SPA_MINBLOCKSIZE) == 0);
 580  585                  ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) ||
 581  586                      dn->dn_maxblkid == 0 || list_head(list) != NULL ||
 582  587                      avl_last(&dn->dn_ranges[txgoff]) ||
 583  588                      dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT ==
 584  589                      dnp->dn_datablkszsec);
 585  590                  dnp->dn_datablkszsec =
 586  591                      dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT;
 587  592                  dn->dn_next_blksz[txgoff] = 0;
 588  593          }
 589  594  
 590      -        if (dn->dn_next_bonuslen[txgoff]) {
      595 +        if (dn->dn_next_bonuslen[txgoff] != 0) {
 591  596                  if (dn->dn_next_bonuslen[txgoff] == DN_ZERO_BONUSLEN)
 592  597                          dnp->dn_bonuslen = 0;
 593  598                  else
 594  599                          dnp->dn_bonuslen = dn->dn_next_bonuslen[txgoff];
 595  600                  ASSERT(dnp->dn_bonuslen <= DN_MAX_BONUSLEN);
 596  601                  dn->dn_next_bonuslen[txgoff] = 0;
 597  602          }
 598  603  
 599      -        if (dn->dn_next_bonustype[txgoff]) {
      604 +        if (dn->dn_next_bonustype[txgoff] != 0) {
 600  605                  ASSERT(DMU_OT_IS_VALID(dn->dn_next_bonustype[txgoff]));
 601  606                  dnp->dn_bonustype = dn->dn_next_bonustype[txgoff];
 602  607                  dn->dn_next_bonustype[txgoff] = 0;
 603  608          }
 604  609  
 605  610          /*
 606  611           * We will either remove a spill block when a file is being removed
 607  612           * or we have been asked to remove it.
 608  613           */
 609  614          if (dn->dn_rm_spillblk[txgoff] ||
 610  615              ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) &&
 611  616              dn->dn_free_txg > 0 && dn->dn_free_txg <= tx->tx_txg)) {
 612  617                  if ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR))
 613  618                          kill_spill = B_TRUE;
 614  619                  dn->dn_rm_spillblk[txgoff] = 0;
 615  620          }
 616  621  
 617      -        if (dn->dn_next_indblkshift[txgoff]) {
      622 +        if (dn->dn_next_indblkshift[txgoff] != 0) {
 618  623                  ASSERT(dnp->dn_nlevels == 1);
 619  624                  dnp->dn_indblkshift = dn->dn_next_indblkshift[txgoff];
 620  625                  dn->dn_next_indblkshift[txgoff] = 0;
 621  626          }
 622  627  
 623  628          /*
 624  629           * Just take the live (open-context) values for checksum and compress.
 625  630           * Strictly speaking it's a future leak, but nothing bad happens if we
 626  631           * start using the new checksum or compress algorithm a little early.
 627  632           */
↓ open down ↓ 69 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX