Print this page
5269 zfs: zpool import slow
PORTING: this code relies on the property of taskq_wait to wait
until no more tasks are queued and no more tasks are active. As
we always queue new tasks from within other tasks, task_wait
reliably waits for the full recursion to finish, even though we
enqueue new tasks after taskq_wait has been called.
On platforms other than illumos, taskq_wait may not have this
property.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: George Wilson <george.wilson@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/zil.h
          +++ new/usr/src/uts/common/fs/zfs/sys/zil.h
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/spa.h>
  33   33  #include <sys/zio.h>
  34   34  #include <sys/dmu.h>
  35   35  
  36   36  #ifdef  __cplusplus
  37   37  extern "C" {
  38   38  #endif
  39   39  
       40 +struct dsl_pool;
       41 +struct dsl_dataset;
       42 +
  40   43  /*
  41   44   * Intent log format:
  42   45   *
  43   46   * Each objset has its own intent log.  The log header (zil_header_t)
  44   47   * for objset N's intent log is kept in the Nth object of the SPA's
  45   48   * intent_log objset.  The log header points to a chain of log blocks,
  46   49   * each of which contains log records (i.e., transactions) followed by
  47   50   * a log block trailer (zil_trailer_t).  The format of a log record
  48   51   * depends on the record (or transaction) type, but all records begin
  49   52   * with a common structure that defines the type, length, and txg.
↓ open down ↓ 347 lines elided ↑ open up ↑
 397  400  extern void     zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx);
 398  401  extern void     zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx);
 399  402  
 400  403  extern itx_t    *zil_itx_create(uint64_t txtype, size_t lrsize);
 401  404  extern void     zil_itx_destroy(itx_t *itx);
 402  405  extern void     zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx);
 403  406  
 404  407  extern void     zil_commit(zilog_t *zilog, uint64_t oid);
 405  408  
 406  409  extern int      zil_vdev_offline(const char *osname, void *txarg);
 407      -extern int      zil_claim(const char *osname, void *txarg);
 408      -extern int      zil_check_log_chain(const char *osname, void *txarg);
      410 +extern int      zil_claim(struct dsl_pool *dp,
      411 +    struct dsl_dataset *ds, void *txarg);
      412 +extern int      zil_check_log_chain(struct dsl_pool *dp,
      413 +    struct dsl_dataset *ds, void *tx);
 409  414  extern void     zil_sync(zilog_t *zilog, dmu_tx_t *tx);
 410  415  extern void     zil_clean(zilog_t *zilog, uint64_t synced_txg);
 411  416  
 412  417  extern int      zil_suspend(const char *osname, void **cookiep);
 413  418  extern void     zil_resume(void *cookie);
 414  419  
 415  420  extern void     zil_add_block(zilog_t *zilog, const blkptr_t *bp);
 416  421  extern int      zil_bp_tree_add(zilog_t *zilog, const blkptr_t *bp);
 417  422  
 418  423  extern void     zil_set_sync(zilog_t *zilog, uint64_t syncval);
 419  424  
 420  425  extern void     zil_set_logbias(zilog_t *zilog, uint64_t slogval);
 421  426  
 422  427  extern int zil_replay_disable;
 423  428  
 424  429  #ifdef  __cplusplus
 425  430  }
 426  431  #endif
 427  432  
 428  433  #endif  /* _SYS_ZIL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX