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/zap.c
          +++ new/usr/src/uts/common/fs/zfs/zap.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  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   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2012 by Delphix. All rights reserved.
  23   24   */
  24   25  
  25   26  /*
  26   27   * This file contains the top half of the zfs directory structure
  27   28   * implementation. The bottom half is in zap_leaf.c.
  28   29   *
  29   30   * The zdir is an extendable hash data structure. There is a table of
  30   31   * pointers to buckets (zap_t->zd_data->zd_leafs). The buckets are
  31   32   * each a constant size and hold a variable number of directory entries.
  32   33   * The buckets (aka "leaf nodes") are implemented in zap_leaf.c.
↓ open down ↓ 906 lines elided ↑ open up ↑
 939  940          if (zap_idx_to_blk(zap, idx, &blk) != 0)
 940  941                  return;
 941  942          bs = FZAP_BLOCK_SHIFT(zap);
 942  943          dmu_prefetch(zap->zap_objset, zap->zap_object, blk << bs, 1 << bs);
 943  944  }
 944  945  
 945  946  /*
 946  947   * Helper functions for consumers.
 947  948   */
 948  949  
      950 +uint64_t
      951 +zap_create_link(objset_t *os, dmu_object_type_t ot, uint64_t parent_obj,
      952 +    const char *name, dmu_tx_t *tx)
      953 +{
      954 +        uint64_t new_obj;
      955 +
      956 +        VERIFY((new_obj = zap_create(os, ot, DMU_OT_NONE, 0, tx)) > 0);
      957 +        VERIFY(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj,
      958 +            tx) == 0);
      959 +
      960 +        return (new_obj);
      961 +}
      962 +
 949  963  int
 950  964  zap_value_search(objset_t *os, uint64_t zapobj, uint64_t value, uint64_t mask,
 951  965      char *name)
 952  966  {
 953  967          zap_cursor_t zc;
 954  968          zap_attribute_t *za;
 955  969          int err;
 956  970  
 957  971          if (mask == 0)
 958  972                  mask = -1ULL;
↓ open down ↓ 396 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX