diff options
author | 2014-01-20 04:47:31 +0000 | |
---|---|---|
committer | 2014-01-20 04:47:31 +0000 | |
commit | 1f300c94c063a53a6d8e07a8b7074d74791a8c02 (patch) | |
tree | 12cb40157116b6620787d966c7d0693da3db1c62 | |
parent | Store the algorithm and key length in the discipline data structure, (diff) | |
download | wireguard-openbsd-1f300c94c063a53a6d8e07a8b7074d74791a8c02.tar.xz wireguard-openbsd-1f300c94c063a53a6d8e07a8b7074d74791a8c02.zip |
Convert the softraid work unit workqs to taskqs.
ok dlg@
-rw-r--r-- | sys/dev/softraid.c | 17 | ||||
-rw-r--r-- | sys/dev/softraidvar.h | 8 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 492db2dd3a5..bb4e43ff187 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.320 2014/01/20 00:11:50 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.321 2014/01/20 04:47:31 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -39,6 +39,7 @@ #include <sys/stat.h> #include <sys/conf.h> #include <sys/uio.h> +#include <sys/task.h> #include <sys/workq.h> #include <sys/kthread.h> #include <sys/dkio.h> @@ -2202,6 +2203,7 @@ sr_wu_init(struct sr_discipline *sd, struct sr_workunit *wu) bzero(wu, sizeof(*wu)); TAILQ_INIT(&wu->swu_ccb); + task_set(&wu->swu_task, sr_wu_done_callback, sd, wu); wu->swu_dis = sd; } @@ -2250,8 +2252,7 @@ sr_wu_done(struct sr_workunit *wu) if (wu->swu_ios_complete < wu->swu_io_count) return; - workq_queue_task(sd->sd_workq, &wu->swu_wqt, 0, - sr_wu_done_callback, sd, wu); + task_add(sd->sd_taskq, &wu->swu_task); } void @@ -3307,9 +3308,9 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, sd = malloc(sizeof(struct sr_discipline), M_DEVBUF, M_WAITOK | M_ZERO); sd->sd_sc = sc; SLIST_INIT(&sd->sd_meta_opt); - sd->sd_workq = workq_create("srdis", 1, IPL_BIO); - if (sd->sd_workq == NULL) { - sr_error(sc, "could not create discipline workq"); + sd->sd_taskq = taskq_create("srdis", 1, IPL_BIO); + if (sd->sd_taskq == NULL) { + sr_error(sc, "could not create discipline taskq"); goto unwind; } if (sr_discipline_init(sd, bc->bc_level)) { @@ -3896,8 +3897,8 @@ sr_discipline_shutdown(struct sr_discipline *sd, int meta_save) sr_chunks_unwind(sc, &sd->sd_vol.sv_chunk_list); - if (sd->sd_workq) - workq_destroy(sd->sd_workq); + if (sd->sd_taskq) + taskq_destroy(sd->sd_taskq); sr_discipline_free(sd); diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h index 23e4092490b..ab183ef70e2 100644 --- a/sys/dev/softraidvar.h +++ b/sys/dev/softraidvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softraidvar.h,v 1.146 2014/01/20 04:38:59 jsing Exp $ */ +/* $OpenBSD: softraidvar.h,v 1.147 2014/01/20 04:47:31 jsing Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -299,6 +299,7 @@ SLIST_HEAD(sr_boot_volume_head, sr_boot_volume); #include <sys/buf.h> #include <sys/queue.h> #include <sys/rwlock.h> +#include <sys/task.h> #include <scsi/scsi_all.h> #include <scsi/scsi_disk.h> @@ -405,8 +406,7 @@ struct sr_workunit { struct sr_ccb_list swu_ccb; /* task memory */ - struct workq_task swu_wqt; - struct workq_task swu_intr; + struct task swu_task; int swu_cb_active; /* in callback */ TAILQ_ENTRY(sr_workunit) swu_link; @@ -540,7 +540,7 @@ struct sr_discipline { } sd_dis_specific;/* dis specific members */ #define mds sd_dis_specific - struct workq *sd_workq; + struct taskq *sd_taskq; /* discipline metadata */ struct sr_metadata *sd_meta; /* in memory copy of metadata */ |