1 /* Buffer (block) cache.
5 /* Data portion of the buffer. */
6 char b_data
[PIPE_BUF
]; /* ordinary user data */
8 /* Header portion of the buffer. */
9 struct buf
*b_next
; /* used to link all free bufs in a chain */
10 struct buf
*b_prev
; /* used to link all free bufs the other way */
11 ino_t b_num
; /* inode number on minor device */
12 dev_t b_dev
; /* major | minor device where block resides */
13 int b_bytes
; /* Number of bytes allocated in bp */
14 int b_count
; /* Number of users of this buffer */
17 /* A block is free if b_dev == NO_DEV. */
19 #define NIL_BUF ((struct buf *) 0) /* indicates absence of a buffer */
21 #define BUFHASH(b) ((b) % NR_BUFS)
23 EXTERN
struct buf
*front
; /* points to least recently used free block */
24 EXTERN
struct buf
*rear
; /* points to most recently used free block */
25 EXTERN
int bufs_in_use
; /* # bufs currently in use (not on free list)*/