Use taskq for dump_bytes()
[zfs.git] / include / sys / spa_impl.h
index 85a825d..47dfe43 100644 (file)
@@ -80,16 +80,16 @@ typedef struct spa_config_dirent {
        char            *scd_path;
 } spa_config_dirent_t;
 
-enum zio_taskq_type {
+typedef enum zio_taskq_type {
        ZIO_TASKQ_ISSUE = 0,
        ZIO_TASKQ_ISSUE_HIGH,
        ZIO_TASKQ_INTERRUPT,
        ZIO_TASKQ_INTERRUPT_HIGH,
        ZIO_TASKQ_TYPES
-};
+} zio_taskq_type_t;
 
 /*
- * State machine for the zpool-pooname process.  The states transitions
+ * State machine for the zpool-poolname process.  The states transitions
  * are done as follows:
  *
  *     From               To                   Routine
@@ -107,6 +107,11 @@ typedef enum spa_proc_state {
        SPA_PROC_GONE           /* spa_thread() is exiting, spa_proc = &p0 */
 } spa_proc_state_t;
 
+typedef struct spa_taskqs {
+       uint_t stqs_count;
+       taskq_t **stqs_taskq;
+} spa_taskqs_t;
+
 struct spa {
        /*
         * Fields protected by spa_namespace_lock.
@@ -125,7 +130,7 @@ struct spa {
        uint8_t         spa_sync_on;            /* sync threads are running */
        spa_load_state_t spa_load_state;        /* current load operation */
        uint64_t        spa_import_flags;       /* import specific flags */
-       taskq_t         *spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
+       spa_taskqs_t    spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
        dsl_pool_t      *spa_dsl_pool;
        boolean_t       spa_is_initializing;    /* true while opening pool */
        metaslab_class_t *spa_normal_class;     /* normal data class */
@@ -141,6 +146,7 @@ struct spa {
        vdev_t          *spa_root_vdev;         /* top-level vdev container */
        uint64_t        spa_config_guid;        /* config pool guid */
        uint64_t        spa_load_guid;          /* spa_load initialized guid */
+       uint64_t        spa_last_synced_guid;   /* last synced guid */
        list_t          spa_config_dirty_list;  /* vdevs with dirty config */
        list_t          spa_state_dirty_list;   /* vdevs with dirty state */
        spa_aux_vdev_t  spa_spares;             /* hot spares */
@@ -226,6 +232,10 @@ struct spa {
        uint64_t        spa_feat_for_write_obj; /* required to write to pool */
        uint64_t        spa_feat_for_read_obj;  /* required to read from pool */
        uint64_t        spa_feat_desc_obj;      /* Feature descriptions */
+       taskqid_t       spa_deadman_tqid;       /* Task id */
+       uint64_t        spa_deadman_calls;      /* number of deadman calls */
+       uint64_t        spa_sync_starttime;     /* starting time fo spa_sync */
+       uint64_t        spa_deadman_synctime;   /* deadman expiration timer */
        /*
         * spa_refcnt & spa_config_lock must be the last elements
         * because refcount_t changes size based on compilation options.
@@ -238,6 +248,12 @@ struct spa {
 
 extern char *spa_config_path;
 
+extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
+    task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
+extern void spa_taskq_dispatch_sync(spa_t *, zio_type_t t, zio_taskq_type_t q,
+    task_func_t *func, void *arg, uint_t flags);
+
+
 #ifdef __cplusplus
 }
 #endif