summaryrefslogtreecommitdiffstats
path: root/sys/sys/buf.h
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-05-26 08:45:29 +0000
committerdg <dg@FreeBSD.org>1994-05-26 08:45:29 +0000
commitb644edeb7c8835b5fad271f62d26b1a26f98e94f (patch)
tree67e4c867748b455307b920c84d29983c2f32b132 /sys/sys/buf.h
parentffb47aff461c647c038c6f1d23fdeb0a798e5bf4 (diff)
downloadFreeBSD-src-b644edeb7c8835b5fad271f62d26b1a26f98e94f.zip
FreeBSD-src-b644edeb7c8835b5fad271f62d26b1a26f98e94f.tar.gz
Moved header definitions to buf.h, and added missing splx() - found
by Johannes Helander.
Diffstat (limited to 'sys/sys/buf.h')
-rw-r--r--sys/sys/buf.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index ac35dae..96517b6 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -139,6 +139,31 @@ struct cluster_save {
struct buf **bs_children; /* List of associated buffers. */
};
+/*
+ * number of buffer hash entries
+ */
+#define BUFHSZ 512
+
+/*
+ * buffer hash table calculation, originally by David Greenman
+ */
+#define BUFHASH(vnp, bn) \
+ (&bufhashtbl[(((int)(vnp) / sizeof(struct vnode))+(int)(bn)) % BUFHSZ])
+
+/*
+ * Definitions for the buffer free lists.
+ */
+#define BUFFER_QUEUES 5 /* number of free buffer queues */
+
+LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
+TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
+
+#define QUEUE_NONE 0 /* on no queue */
+#define QUEUE_LOCKED 1 /* locked buffers */
+#define QUEUE_LRU 2 /* useful buffers */
+#define QUEUE_AGE 3 /* less useful buffers */
+#define QUEUE_EMPTY 4 /* empty buffer headers*/
+
/*
* Zero out the buffer's data area.
*/
OpenPOWER on IntegriCloud