summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-03 03:14:29 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-03 03:14:29 +0000
commit0d45748b5f9e901e134b2062f61a5f4e59f4fba3 (patch)
tree4696d4855d8f5dc57cca372fe194b0af846621de
parentc83610475c84770d23c294b4c28295dc5476024a (diff)
remove the never used bufq_ code.
ok oga@ 'dance for me' blambert@
-rw-r--r--sys/kern/subr_disk.c59
-rw-r--r--sys/sys/buf.h27
2 files changed, 2 insertions, 84 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 65707d76ba9..4e5e3ba504a 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.88 2009/05/15 01:57:16 deraadt Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.89 2009/06/03 03:14:28 thib Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -965,63 +965,6 @@ dk_mountroot(void)
return (*mountrootfn)();
}
-struct bufq *
-bufq_default_alloc(void)
-{
- struct bufq_default *bq;
-
- bq = malloc(sizeof(*bq), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (bq == NULL)
- panic("bufq_default_alloc: no memory");
-
- 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)
-{
- struct bufq_default *bufq = (struct bufq_default *)bq;
- struct proc *p = bp->b_proc;
- struct buf *head;
-
- if (p == NULL || p->p_nice < NZERO)
- head = &bufq->bufq_head[0];
- else if (p->p_nice == NZERO)
- head = &bufq->bufq_head[1];
- else
- head = &bufq->bufq_head[2];
-
- disksort(head, bp);
-}
-
-struct buf *
-bufq_default_get(struct bufq *bq)
-{
- struct bufq_default *bufq = (struct bufq_default *)bq;
- struct buf *bp, *head;
- int i;
-
- for (i = 0; i < 3; i++) {
- head = &bufq->bufq_head[i];
- if ((bp = head->b_actf))
- break;
- }
- if (bp == NULL)
- return (NULL);
- head->b_actf = bp->b_actf;
- return (bp);
-}
-
struct device *
getdisk(char *str, int len, int defpart, dev_t *devp)
{
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index c3898a15616..dc173eb6233 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.h,v 1.61 2009/04/22 13:12:26 art Exp $ */
+/* $OpenBSD: buf.h,v 1.62 2009/06/03 03:14:28 thib Exp $ */
/* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */
/*
@@ -107,31 +107,6 @@ struct buf {
};
/*
- * bufq
- * flexible buffer queue routines
- */
-struct bufq {
- void (*bufq_free)(struct bufq *);
- void (*bufq_add)(struct bufq *, struct buf *);
- struct buf *(*bufq_get)(struct bufq *);
-};
-
-struct bufq_default {
- struct bufq bufq;
- struct buf bufq_head[3];
-};
-
-#define BUFQ_ALLOC(_type) bufq_default_alloc() /* XXX */
-#define BUFQ_FREE(_bufq) (_bufq)->bufq_free(_bufq)
-#define BUFQ_ADD(_bufq, _bp) (_bufq)->bufq_add(_bufq, _bp)
-#define BUFQ_GET(_bufq) (_bufq)->bufq_get(_bufq)
-
-struct bufq *bufq_default_alloc(void);
-void bufq_default_free(struct bufq *);
-void bufq_default_add(struct bufq *, struct buf *);
-struct buf *bufq_default_get(struct bufq *);
-
-/*
* For portability with historic industry practice, the cylinder number has
* to be maintained in the `b_resid' field.
*/