Print this page
zpool import speedup

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dsl_pool.c
          +++ new/usr/src/uts/common/fs/zfs/dsl_pool.c
↓ open down ↓ 995 lines elided ↑ open up ↑
 996  996   * infrastructure enforces proper locking strategy with respect to the
 997  997   * dp_config_rwlock.  See the comment above dsl_sync_task() for details.
 998  998   *
 999  999   * Read-only operations will manually hold the pool, then the dataset, obtain
1000 1000   * information from the dataset, then release the pool and dataset.
1001 1001   * dmu_objset_{hold,rele}() are convenience routines that also do the pool
1002 1002   * hold/rele.
1003 1003   */
1004 1004  
1005 1005  int
1006      -dsl_pool_hold(const char *name, void *tag, dsl_pool_t **dp)
     1006 +dsl_pool_hold_lock(const char *name, void *tag, dsl_pool_t **dp, int lock)
1007 1007  {
1008 1008          spa_t *spa;
1009 1009          int error;
1010 1010  
1011      -        error = spa_open(name, &spa, tag);
     1011 +        error = spa_open_lock(name, &spa, tag, lock);
1012 1012          if (error == 0) {
1013 1013                  *dp = spa_get_dsl(spa);
1014 1014                  dsl_pool_config_enter(*dp, tag);
1015 1015          }
1016 1016          return (error);
1017 1017  }
1018 1018  
     1019 +int
     1020 +dsl_pool_hold(const char *name, void *tag, dsl_pool_t **dp)
     1021 +{
     1022 +        return (dsl_pool_hold_lock(name, tag, dp, 1));
     1023 +}
     1024 +
1019 1025  void
1020 1026  dsl_pool_rele(dsl_pool_t *dp, void *tag)
1021 1027  {
1022 1028          dsl_pool_config_exit(dp, tag);
1023 1029          spa_close(dp->dp_spa, tag);
1024 1030  }
1025 1031  
1026 1032  void
1027 1033  dsl_pool_config_enter(dsl_pool_t *dp, void *tag)
1028 1034  {
↓ open down ↓ 27 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX