Print this page
5269 zfs: zpool import slow
While importing a pool all objsets are enumerated twice, once to check
the zil log chains and once to claim them. On pools with many datasets
this process might take a substantial amount of time.
Speed up the process by parallelizing it utilizing a taskq. The number
of parallel tasks is limited to 4 times the number of leaf vdevs.

@@ -30,10 +30,12 @@
 
 #include <sys/types.h>
 #include <sys/spa.h>
 #include <sys/zio.h>
 #include <sys/dmu.h>
+#include <sys/dsl_pool.h>
+#include <sys/dsl_dataset.h>
 
 #ifdef  __cplusplus
 extern "C" {
 #endif
 

@@ -403,12 +405,13 @@
 extern void     zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx);
 
 extern void     zil_commit(zilog_t *zilog, uint64_t oid);
 
 extern int      zil_vdev_offline(const char *osname, void *txarg);
-extern int      zil_claim(const char *osname, void *txarg);
-extern int      zil_check_log_chain(const char *osname, void *txarg);
+extern int      zil_claim(dsl_pool_t *dp, dsl_dataset_t *ds, void *txarg);
+extern int      zil_check_log_chain(dsl_pool_t *dp, dsl_dataset_t *ds,
+    void *tx);
 extern void     zil_sync(zilog_t *zilog, dmu_tx_t *tx);
 extern void     zil_clean(zilog_t *zilog, uint64_t synced_txg);
 
 extern int      zil_suspend(const char *osname, void **cookiep);
 extern void     zil_resume(void *cookie);