summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-01-21 21:00:15 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-01-21 21:00:15 +0000
commitebb2ffc8e85899bbaee09799b6cdce3d0b4a4b6a (patch)
tree0f8f55315ee867520dcd6cd6f0b9cdb4e3132584 /sys/kern
parent9587f4726653700be7c8373209210bcf9512711e (diff)
dynamic bufq support. basically a nullop. ok grange@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index cace466e490..7802ac73801 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.23 2003/06/25 20:52:57 tedu Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.24 2004/01/21 21:00:14 tedu Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -526,6 +526,26 @@ dk_mountroot()
return (*mountrootfn)();
}
+struct bufq *
+bufq_default_alloc(void)
+{
+ struct bufq_default *bq;
+
+ bq = malloc(sizeof(*bq), M_DEVBUF, M_NOWAIT);
+ memset(bq, 0, sizeof(*bq));
+ bq->bufq.bufq_free = bufq_default_free;
+ bq->bufq.bufq_add = bufq_default_add;
+ bq->bufq.bufq_get = bufq_default_get;
+
+ return ((struct bufq *)bq);
+}
+
+void
+bufq_default_free(struct bufq *bq)
+{
+ free(bq, M_DEVBUF);
+}
+
void
bufq_default_add(struct bufq *bq, struct buf *bp)
{