From: Mike Larkin Subject: Re: remove bufq_requeue() To: tech@openbsd.org Date: Sat, 6 Jul 2024 01:55:12 -0700 On Sat, Jul 06, 2024 at 03:25:19PM +1000, Jonathan Gray wrote: > remove bufq_requeue(), last used by sys/scsi in 2017 > actually for the bufq ones, maybe beck is/was gonna use them? Shrug. > diff --git share/man/man9/bufq_init.9 share/man/man9/bufq_init.9 > index cc9c5a033bb..7e22116df77 100644 > --- share/man/man9/bufq_init.9 > +++ share/man/man9/bufq_init.9 > @@ -23,7 +23,6 @@ > .Nm bufq_destroy , > .Nm bufq_queue , > .Nm bufq_dequeue , > -.Nm bufq_requeue , > .Nm bufq_peek , > .Nm bufq_drain > .\" .Nm bufq_wait , > @@ -43,8 +42,6 @@ > .Fn bufq_queue "struct bufq *bufq" "struct buf *bp" > .Ft struct buf * > .Fn bufq_dequeue "struct bufq *bufq" > -.Ft void > -.Fn bufq_requeue "struct bufq *bufq" "struct buf *bp" > .Ft int > .Fn bufq_peek "struct bufq *bufq" > .Ft void > @@ -106,12 +103,6 @@ is used to get the next buf the > has scheduled to be serviced by a disk. > The buf will be removed from the queue. > .Pp > -.Fn bufq_requeue > -can be used to return a previously dequeued buf specified by > -.Fa bp > -to the head of the queue of > -.Fa bufq . > -.Pp > .Fn bufq_peek > allows the caller to determine if there are more bufs queued on > .Fa bufq > @@ -134,7 +125,6 @@ can be called during autoconf, or from process context. > .Pp > .Nm bufq_queue , > .Nm bufq_dequeue , > -.Nm bufq_requeue , > .Nm bufq_peek , > and > .Nm bufq_drain > diff --git sys/kern/kern_bufq.c sys/kern/kern_bufq.c > index 505770176c4..6bc42e2c874 100644 > --- sys/kern/kern_bufq.c > +++ sys/kern/kern_bufq.c > @@ -35,7 +35,6 @@ struct bufq_impl { > > void (*impl_queue)(void *, struct buf *); > struct buf *(*impl_dequeue)(void *); > - void (*impl_requeue)(void *, struct buf *); > int (*impl_peek)(void *); > }; > > @@ -43,14 +42,12 @@ void *bufq_fifo_create(void); > void bufq_fifo_destroy(void *); > void bufq_fifo_queue(void *, struct buf *); > struct buf *bufq_fifo_dequeue(void *); > -void bufq_fifo_requeue(void *, struct buf *); > int bufq_fifo_peek(void *); > > void *bufq_nscan_create(void); > void bufq_nscan_destroy(void *); > void bufq_nscan_queue(void *, struct buf *); > struct buf *bufq_nscan_dequeue(void *); > -void bufq_nscan_requeue(void *, struct buf *); > int bufq_nscan_peek(void *); > > const struct bufq_impl bufq_impls[BUFQ_HOWMANY] = { > @@ -59,7 +56,6 @@ const struct bufq_impl bufq_impls[BUFQ_HOWMANY] = { > bufq_fifo_destroy, > bufq_fifo_queue, > bufq_fifo_dequeue, > - bufq_fifo_requeue, > bufq_fifo_peek > }, > { > @@ -67,7 +63,6 @@ const struct bufq_impl bufq_impls[BUFQ_HOWMANY] = { > bufq_nscan_destroy, > bufq_nscan_queue, > bufq_nscan_dequeue, > - bufq_nscan_requeue, > bufq_nscan_peek > } > }; > @@ -201,14 +196,6 @@ bufq_dequeue(struct bufq *bq) > return (bp); > } > > -void > -bufq_requeue(struct bufq *bq, struct buf *bp) > -{ > - mtx_enter(&bq->bufq_mtx); > - bq->bufq_impl->impl_requeue(bq->bufq_data, bp); > - mtx_leave(&bq->bufq_mtx); > -} > - > int > bufq_peek(struct bufq *bq) > { > @@ -354,14 +341,6 @@ bufq_fifo_dequeue(void *data) > return (bp); > } > > -void > -bufq_fifo_requeue(void *data, struct buf *bp) > -{ > - struct bufq_fifo_head *head = data; > - > - SIMPLEQ_INSERT_HEAD(head, bp, b_bufq.bufq_data_fifo.bqf_entries); > -} > - > int > bufq_fifo_peek(void *data) > { > @@ -491,14 +470,6 @@ bufq_nscan_dequeue(void *vdata) > return (bp); > } > > -void > -bufq_nscan_requeue(void *vdata, struct buf *bp) > -{ > - struct bufq_nscan_data *data = vdata; > - > - SIMPLEQ_INSERT_HEAD(&data->fifo, bp, dsentries); > -} > - > int > bufq_nscan_peek(void *vdata) > { > diff --git sys/sys/buf.h sys/sys/buf.h > index d123377383f..c7feb84cab1 100644 > --- sys/sys/buf.h > +++ sys/sys/buf.h > @@ -89,7 +89,6 @@ void bufq_destroy(struct bufq *); > > void bufq_queue(struct bufq *, struct buf *); > struct buf *bufq_dequeue(struct bufq *); > -void bufq_requeue(struct bufq *, struct buf *); > int bufq_peek(struct bufq *); > void bufq_drain(struct bufq *); > >