Print this page
8115 parallel zfs mount

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dnode.c
          +++ new/usr/src/uts/common/fs/zfs/dnode.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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   23   * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  24   24   * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  25   25   * Copyright (c) 2014 Integros [integros.com]
       26 + * Copyright 2017 RackTop Systems.
  26   27   */
  27   28  
  28   29  #include <sys/zfs_context.h>
  29   30  #include <sys/dbuf.h>
  30   31  #include <sys/dnode.h>
  31   32  #include <sys/dmu.h>
  32   33  #include <sys/dmu_impl.h>
  33   34  #include <sys/dmu_tx.h>
  34   35  #include <sys/dmu_objset.h>
  35   36  #include <sys/dsl_dir.h>
↓ open down ↓ 16 lines elided ↑ open up ↑
  52   53  #define DNODE_STAT_ADD(stat)                    ((stat)++)
  53   54  #else
  54   55  #define DNODE_STAT_ADD(stat)                    /* nothing */
  55   56  #endif  /* DNODE_STATS */
  56   57  
  57   58  static dnode_phys_t dnode_phys_zero;
  58   59  
  59   60  int zfs_default_bs = SPA_MINBLOCKSHIFT;
  60   61  int zfs_default_ibs = DN_MAX_INDBLKSHIFT;
  61   62  
       63 +#ifdef  _KERNEL
  62   64  static kmem_cbrc_t dnode_move(void *, void *, size_t, void *);
       65 +#endif  /* _KERNEL */
  63   66  
  64   67  static int
  65   68  dbuf_compare(const void *x1, const void *x2)
  66   69  {
  67   70          const dmu_buf_impl_t *d1 = x1;
  68   71          const dmu_buf_impl_t *d2 = x2;
  69   72  
  70   73          if (d1->db_level < d2->db_level) {
  71   74                  return (-1);
  72   75          }
↓ open down ↓ 133 lines elided ↑ open up ↑
 206  209          avl_destroy(&dn->dn_dbufs);
 207  210  }
 208  211  
 209  212  void
 210  213  dnode_init(void)
 211  214  {
 212  215          ASSERT(dnode_cache == NULL);
 213  216          dnode_cache = kmem_cache_create("dnode_t",
 214  217              sizeof (dnode_t),
 215  218              0, dnode_cons, dnode_dest, NULL, NULL, NULL, 0);
      219 +#ifdef  _KERNEL
 216  220          kmem_cache_set_move(dnode_cache, dnode_move);
      221 +#endif  /* _KERNEL */
 217  222  }
 218  223  
 219  224  void
 220  225  dnode_fini(void)
 221  226  {
 222  227          kmem_cache_destroy(dnode_cache);
 223  228          dnode_cache = NULL;
 224  229  }
 225  230  
 226  231  
↓ open down ↓ 463 lines elided ↑ open up ↑
 690  695          uint64_t dms_dnode_invalid;
 691  696          uint64_t dms_dnode_recheck1;
 692  697          uint64_t dms_dnode_recheck2;
 693  698          uint64_t dms_dnode_special;
 694  699          uint64_t dms_dnode_handle;
 695  700          uint64_t dms_dnode_rwlock;
 696  701          uint64_t dms_dnode_active;
 697  702  } dnode_move_stats;
 698  703  #endif  /* DNODE_STATS */
 699  704  
      705 +#ifdef  _KERNEL
 700  706  static void
 701  707  dnode_move_impl(dnode_t *odn, dnode_t *ndn)
 702  708  {
 703  709          int i;
 704  710  
 705  711          ASSERT(!RW_LOCK_HELD(&odn->dn_struct_rwlock));
 706  712          ASSERT(MUTEX_NOT_HELD(&odn->dn_mtx));
 707  713          ASSERT(MUTEX_NOT_HELD(&odn->dn_dbufs_mtx));
 708  714          ASSERT(!RW_LOCK_HELD(&odn->dn_zfetch.zf_rwlock));
 709  715  
↓ open down ↓ 116 lines elided ↑ open up ↑
 826  832          odn->dn_newgid = 0;
 827  833          odn->dn_id_flags = 0;
 828  834  
 829  835          /*
 830  836           * Mark the dnode.
 831  837           */
 832  838          ndn->dn_moved = 1;
 833  839          odn->dn_moved = (uint8_t)-1;
 834  840  }
 835  841  
 836      -#ifdef  _KERNEL
 837  842  /*ARGSUSED*/
 838  843  static kmem_cbrc_t
 839  844  dnode_move(void *buf, void *newbuf, size_t size, void *arg)
 840  845  {
 841  846          dnode_t *odn = buf, *ndn = newbuf;
 842  847          objset_t *os;
 843  848          int64_t refcount;
 844  849          uint32_t dbufs;
 845  850  
 846  851          /*
↓ open down ↓ 1147 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX