Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sa.c
          +++ new/usr/src/uts/common/fs/zfs/sa.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23   24   * Portions Copyright 2011 iXsystems, Inc
       25 + * Copyright (c) 2012 by Delphix. All rights reserved.
  24   26   */
  25   27  
  26   28  #include <sys/zfs_context.h>
  27   29  #include <sys/types.h>
  28   30  #include <sys/param.h>
  29   31  #include <sys/systm.h>
  30   32  #include <sys/sysmacros.h>
  31   33  #include <sys/dmu.h>
  32   34  #include <sys/dmu_impl.h>
  33   35  #include <sys/dmu_objset.h>
↓ open down ↓ 386 lines elided ↑ open up ↑
 420  422              KM_SLEEP);
 421  423          bcopy(attrs, tb->lot_attrs, sizeof (sa_attr_type_t) * attr_count);
 422  424          tb->lot_num = lot_num;
 423  425          tb->lot_hash = hash;
 424  426          tb->lot_instance = 0;
 425  427  
 426  428          if (zapadd) {
 427  429                  char attr_name[8];
 428  430  
 429  431                  if (sa->sa_layout_attr_obj == 0) {
 430      -                        sa->sa_layout_attr_obj = zap_create(os,
 431      -                            DMU_OT_SA_ATTR_LAYOUTS, DMU_OT_NONE, 0, tx);
 432      -                        VERIFY(zap_add(os, sa->sa_master_obj, SA_LAYOUTS, 8, 1,
 433      -                            &sa->sa_layout_attr_obj, tx) == 0);
      432 +                        sa->sa_layout_attr_obj = zap_create_link(os,
      433 +                            DMU_OT_SA_ATTR_LAYOUTS,
      434 +                            sa->sa_master_obj, SA_LAYOUTS, tx);
 434  435                  }
 435  436  
 436  437                  (void) snprintf(attr_name, sizeof (attr_name),
 437  438                      "%d", (int)lot_num);
 438  439                  VERIFY(0 == zap_update(os, os->os_sa->sa_layout_attr_obj,
 439  440                      attr_name, 2, attr_count, attrs, tx));
 440  441          }
 441  442  
 442  443          list_create(&tb->lot_idx_tab, sizeof (sa_idx_tab_t),
 443  444              offsetof(sa_idx_tab_t, sa_next));
↓ open down ↓ 1101 lines elided ↑ open up ↑
1545 1546          int i;
1546 1547  
1547 1548          mutex_enter(&sa->sa_lock);
1548 1549  
1549 1550          if (!sa->sa_need_attr_registration || sa->sa_master_obj == NULL) {
1550 1551                  mutex_exit(&sa->sa_lock);
1551 1552                  return;
1552 1553          }
1553 1554  
1554 1555          if (sa->sa_reg_attr_obj == NULL) {
1555      -                sa->sa_reg_attr_obj = zap_create(hdl->sa_os,
1556      -                    DMU_OT_SA_ATTR_REGISTRATION, DMU_OT_NONE, 0, tx);
1557      -                VERIFY(zap_add(hdl->sa_os, sa->sa_master_obj,
1558      -                    SA_REGISTRY, 8, 1, &sa->sa_reg_attr_obj, tx) == 0);
     1556 +                sa->sa_reg_attr_obj = zap_create_link(hdl->sa_os,
     1557 +                    DMU_OT_SA_ATTR_REGISTRATION,
     1558 +                    sa->sa_master_obj, SA_REGISTRY, tx);
1559 1559          }
1560 1560          for (i = 0; i != sa->sa_num_attrs; i++) {
1561 1561                  if (sa->sa_attr_table[i].sa_registered)
1562 1562                          continue;
1563 1563                  ATTR_ENCODE(attr_value, tb[i].sa_attr, tb[i].sa_length,
1564 1564                      tb[i].sa_byteswap);
1565 1565                  VERIFY(0 == zap_update(hdl->sa_os, sa->sa_reg_attr_obj,
1566 1566                      tb[i].sa_name, 8, 1, &attr_value, tx));
1567 1567                  tb[i].sa_registered = B_TRUE;
1568 1568          }
↓ open down ↓ 403 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX