--- Net2/sys/buf.h 2018/04/24 18:10:42 1.1.1.2 +++ Net2/sys/buf.h 2018/04/24 18:16:55 1.1.1.3 @@ -30,17 +30,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)buf.h 7.11 (Berkeley) 5/9/90 - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00007 - * -------------------- ----- ---------------------- - * - * 20 Aug 92 David Greenman Fixed buffer cache hash index - * calculation + * from: @(#)buf.h 7.11 (Berkeley) 5/9/90 + * buf.h,v 1.9 1993/07/19 16:39:23 cgd Exp */ +#ifndef _SYS_BUF_H_ +#define _SYS_BUF_H_ + /* * The header for buffers in the buffer pool and otherwise used * to describe a block i/o request is given here. @@ -127,32 +123,34 @@ struct buf ((struct buf *)&bufhash[((int)(dvp)/sizeof(struct vnode)+(int)(dblkno)) % BUFHSZ]) #endif -struct buf *buf; /* the buffer pool itself */ -char *buffers; -int nbuf; /* number of buffer headers */ -int bufpages; /* number of memory pages in the buffer pool */ -struct buf *swbuf; /* swap I/O headers */ -int nswbuf; -struct bufhd bufhash[BUFHSZ]; /* heads of hash lists */ -struct buf bfreelist[BQUEUES]; /* heads of available lists */ -struct buf bswlist; /* head of free swap header list */ -struct buf *bclnlist; /* head of cleaned page list */ - -void bufinit(); -int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); -int breada(struct vnode *, daddr_t, int, daddr_t, int, struct ucred *, - struct buf **); -int bwrite(struct buf *); -void bawrite(struct buf *); -void bdwrite(struct buf *); -void brelse(struct buf *); -struct buf *incore(struct vnode *, daddr_t); -struct buf *getblk(struct vnode *, daddr_t, int); -struct buf *geteblk(int); -int biowait(struct buf *); -int biodone(struct buf *); -void allocbuf(struct buf *, int); +extern struct buf *buf; /* the buffer pool itself */ +extern char *buffers; +extern int nbuf; /* number of buffer headers */ +extern int bufpages; /* number of memory pages in the buffer pool */ +extern struct buf *swbuf; /* swap I/O headers */ +extern int nswbuf; +extern struct bufhd bufhash[BUFHSZ]; /* heads of hash lists */ +extern struct buf bfreelist[BQUEUES]; /* heads of available lists */ +extern struct buf bswlist; /* head of free swap header list */ +extern struct buf *bclnlist; /* head of cleaned page list */ + +void bufinit __P((void)); +int bread __P((struct vnode *, daddr_t, int, struct ucred *, + struct buf **)); +int breada __P((struct vnode *, daddr_t, int, daddr_t, int, + struct ucred *, struct buf **)); +int bwrite __P((struct buf *)); +void bdwrite __P((struct buf *)); +void bawrite __P((struct buf *)); +void brelse __P((struct buf *)); +struct buf *incore __P((struct vnode *, daddr_t)); +struct buf *getblk __P((struct vnode *, daddr_t, int)); +struct buf *geteblk __P((int)); +void allocbuf __P((struct buf *, int)); +int biowait __P((struct buf *)); +void biodone __P((struct buf *)); +u_int minphys __P((struct buf *)); #endif /* @@ -229,3 +227,5 @@ void allocbuf(struct buf *, int); } #define B_CLRBUF 0x1 /* request allocated buffer be cleared */ #define B_SYNC 0x2 /* do all allocations synchronously */ + +#endif /* !_SYS_BUF_H_ */