-#define B_WRITE 0x00000 /* non-read pseudo-flag */
-#define B_READ 0x00001 /* read when I/O occurs */
-#define B_DONE 0x00002 /* transaction finished */
-#define B_ERROR 0x00004 /* transaction aborted */
-#define B_BUSY 0x00008 /* not on av_forw/back list */
-#define B_PHYS 0x00010 /* physical IO */
-#define B_MAP 0x00020 /* UNIBUS map allocated */
-#define B_WANTED 0x00040 /* issue wakeup when BUSY goes off */
-#define B_AGE 0x00080 /* delayed write for correct aging */
-#define B_ASYNC 0x00100 /* don't wait for I/O completion */
-#define B_DELWRI 0x00200 /* write at exit of avail list */
-#define B_TAPE 0x00400 /* this is a magtape (no bdwrite) */
-#define B_UAREA 0x00800 /* add u-area to a swap operation */
-#define B_PAGET 0x01000 /* page in/out of page table space */
-#define B_DIRTY 0x02000 /* dirty page to be pushed out async */
-#define B_PGIN 0x04000 /* pagein op, so swap() can count it */
-#define B_CACHE 0x08000 /* did bread find us in the cache ? */
-#define B_INVAL 0x10000 /* does not contain valid info (if not BUSY) */
-#define B_LOCKED 0x20000 /* this buffer locked in core (not reusable) */
-#define B_HEAD 0x40000 /* this is a buffer header, not a buffer */
+#define B_WRITE 0x000000 /* non-read pseudo-flag */
+#define B_READ 0x000001 /* read when I/O occurs */
+#define B_DONE 0x000002 /* transaction finished */
+#define B_ERROR 0x000004 /* transaction aborted */
+#define B_BUSY 0x000008 /* not on av_forw/back list */
+#define B_PHYS 0x000010 /* physical IO */
+#define B_XXX 0x000020 /* was B_MAP, alloc UNIBUS on pdp-11 */
+#define B_WANTED 0x000040 /* issue wakeup when BUSY goes off */
+#define B_AGE 0x000080 /* delayed write for correct aging */
+#define B_ASYNC 0x000100 /* don't wait for I/O completion */
+#define B_DELWRI 0x000200 /* write at exit of avail list */
+#define B_TAPE 0x000400 /* this is a magtape (no bdwrite) */
+#define B_UAREA 0x000800 /* add u-area to a swap operation */
+#define B_PAGET 0x001000 /* page in/out of page table space */
+#define B_DIRTY 0x002000 /* dirty page to be pushed out async */
+#define B_PGIN 0x004000 /* pagein op, so swap() can count it */
+#define B_CACHE 0x008000 /* did bread find us in the cache ? */
+#define B_INVAL 0x010000 /* does not contain valid info */
+#define B_LOCKED 0x020000 /* locked in core (not reusable) */
+#define B_HEAD 0x040000 /* a buffer header, not a buffer */
+#define B_BAD 0x100000 /* bad block revectoring in progress */
+#define B_CALL 0x200000 /* call b_iodone from iodone */
+#define B_RAW 0x400000 /* set by physio for raw transfers */
+#define B_NOCACHE 0x800000 /* do not cache block after use */
+
+/*
+ * Insq/Remq for the buffer hash lists.
+ */
+#define bremhash(bp) { \
+ (bp)->b_back->b_forw = (bp)->b_forw; \
+ (bp)->b_forw->b_back = (bp)->b_back; \
+}
+#define binshash(bp, dp) { \
+ (bp)->b_forw = (dp)->b_forw; \
+ (bp)->b_back = (dp); \
+ (dp)->b_forw->b_back = (bp); \
+ (dp)->b_forw = (bp); \
+}
+
+/*
+ * Insq/Remq for the buffer free lists.
+ */
+#define bremfree(bp) { \
+ (bp)->av_back->av_forw = (bp)->av_forw; \
+ (bp)->av_forw->av_back = (bp)->av_back; \
+}
+#define binsheadfree(bp, dp) { \
+ (dp)->av_forw->av_back = (bp); \
+ (bp)->av_forw = (dp)->av_forw; \
+ (dp)->av_forw = (bp); \
+ (bp)->av_back = (dp); \
+}
+#define binstailfree(bp, dp) { \
+ (dp)->av_back->av_forw = (bp); \
+ (bp)->av_back = (dp)->av_back; \
+ (dp)->av_back = (bp); \
+ (bp)->av_forw = (dp); \
+}
+
+#define iodone biodone
+#define iowait biowait