diff --git a/sys/geom/geom_int.h b/sys/geom/geom_int.h index 9f2a011b23f..67c46d71588 100644 --- a/sys/geom/geom_int.h +++ b/sys/geom/geom_int.h @@ -69,6 +69,8 @@ void g_io_schedule_up(struct thread *tp); /* geom_kern.c / geom_kernsim.c */ void g_init(void); +extern struct thread *g_up_td; +extern struct thread *g_down_td; extern int g_shutdown; extern int g_notaste; diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index a5cb8c7279e..e893793ec38 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -561,7 +561,7 @@ g_io_request(struct bio *bp, struct g_consumer *cp) direct = (cp->flags & G_CF_DIRECT_SEND) != 0 && (pp->flags & G_PF_DIRECT_RECEIVE) != 0 && - !g_is_geom_thread(curthread) && + curthread != g_down_td && ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 || (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()) && pace == 0; @@ -653,7 +653,7 @@ g_io_deliver(struct bio *bp, int error) direct = (pp->flags & G_PF_DIRECT_SEND) && (cp->flags & G_CF_DIRECT_RECEIVE) && - !g_is_geom_thread(curthread); + curthread != g_up_td; if (direct) { /* Block direct execution if less then half of stack left. */ size_t st, su; diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 4b7219591dc..429bd7a05a4 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -61,8 +61,8 @@ MALLOC_DEFINE(M_GEOM, "GEOM", "Geom data structures"); struct sx topology_lock; static struct proc *g_proc; -static struct thread __read_mostly *g_up_td; -static struct thread __read_mostly *g_down_td; +struct thread __read_mostly *g_up_td; +struct thread __read_mostly *g_down_td; static struct thread __read_mostly *g_event_td; int __read_mostly g_debugflags;