Deleted Added
full compact
buf.h (1542) buf.h (1549)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 40 unchanged lines hidden (view full) ---

49 */
50struct buf {
51 LIST_ENTRY(buf) b_hash; /* Hash chain. */
52 LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
53 TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
54 struct buf *b_actf, **b_actb; /* Device driver queue when active. */
55 struct proc *b_proc; /* Associated proc; NULL if kernel. */
56 volatile long b_flags; /* B_* flags. */
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 40 unchanged lines hidden (view full) ---

49 */
50struct buf {
51 LIST_ENTRY(buf) b_hash; /* Hash chain. */
52 LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
53 TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
54 struct buf *b_actf, **b_actb; /* Device driver queue when active. */
55 struct proc *b_proc; /* Associated proc; NULL if kernel. */
56 volatile long b_flags; /* B_* flags. */
57 int b_qindex; /* buffer queue index */
57 int b_error; /* Errno value. */
58 long b_bufsize; /* Allocated buffer size. */
59 long b_bcount; /* Valid bytes in buffer. */
60 long b_resid; /* Remaining I/O. */
61 dev_t b_dev; /* Device associated with buffer. */
62 struct {
63 caddr_t b_addr; /* Memory, superblocks, indirect etc. */
64 } b_un;

--- 5 unchanged lines hidden (view full) ---

70 struct vnode *b_vp; /* Device vnode. */
71 int b_pfcent; /* Center page when swapping cluster. */
72 int b_dirtyoff; /* Offset in buffer of dirty region. */
73 int b_dirtyend; /* Offset of end of dirty region. */
74 struct ucred *b_rcred; /* Read credentials reference. */
75 struct ucred *b_wcred; /* Write credentials reference. */
76 int b_validoff; /* Offset in buffer of valid region. */
77 int b_validend; /* Offset of end of valid region. */
58 int b_error; /* Errno value. */
59 long b_bufsize; /* Allocated buffer size. */
60 long b_bcount; /* Valid bytes in buffer. */
61 long b_resid; /* Remaining I/O. */
62 dev_t b_dev; /* Device associated with buffer. */
63 struct {
64 caddr_t b_addr; /* Memory, superblocks, indirect etc. */
65 } b_un;

--- 5 unchanged lines hidden (view full) ---

71 struct vnode *b_vp; /* Device vnode. */
72 int b_pfcent; /* Center page when swapping cluster. */
73 int b_dirtyoff; /* Offset in buffer of dirty region. */
74 int b_dirtyend; /* Offset of end of dirty region. */
75 struct ucred *b_rcred; /* Read credentials reference. */
76 struct ucred *b_wcred; /* Write credentials reference. */
77 int b_validoff; /* Offset in buffer of valid region. */
78 int b_validend; /* Offset of end of valid region. */
79 daddr_t b_pblkno; /* physical block number */
80 caddr_t b_savekva; /* saved kva for transfer while bouncing */
81 TAILQ_HEAD(b_clusterhd,buf) b_cluster; /* low level clustering */
82 void *b_driver1; /* for private use by the driver */
83 void *b_driver2; /* for private use by the driver */
84 void *b_spc;
85
78};
79
80/* Device driver compatibility definitions. */
81#define b_active b_bcount /* Driver queue head: drive active. */
82#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
83#define b_errcnt b_resid /* Retry count while I/O in progress. */
84#define iodone biodone /* Old name for biodone. */
85#define iowait biowait /* Old name for biowait. */

--- 23 unchanged lines hidden (view full) ---

109#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
110#define B_READ 0x00100000 /* Read buffer. */
111#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
112#define B_UAREA 0x00400000 /* Buffer describes Uarea I/O. */
113#define B_WANTED 0x00800000 /* Process wants this buffer. */
114#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
115#define B_WRITEINPROG 0x01000000 /* Write in progress. */
116#define B_XXX 0x02000000 /* Debugging flag. */
86};
87
88/* Device driver compatibility definitions. */
89#define b_active b_bcount /* Driver queue head: drive active. */
90#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
91#define b_errcnt b_resid /* Retry count while I/O in progress. */
92#define iodone biodone /* Old name for biodone. */
93#define iowait biowait /* Old name for biowait. */

--- 23 unchanged lines hidden (view full) ---

117#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
118#define B_READ 0x00100000 /* Read buffer. */
119#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
120#define B_UAREA 0x00400000 /* Buffer describes Uarea I/O. */
121#define B_WANTED 0x00800000 /* Process wants this buffer. */
122#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
123#define B_WRITEINPROG 0x01000000 /* Write in progress. */
124#define B_XXX 0x02000000 /* Debugging flag. */
125#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
126#define B_BOUNCE 0x80000000 /* bounce buffer flag */
117
118/*
119 * This structure describes a clustered I/O. It is stored in the b_saveaddr
120 * field of the buffer on which I/O is done. At I/O completion, cluster
121 * callback uses the structure to parcel I/O's to individual buffers, and
122 * then free's this structure.
123 */
124struct cluster_save {

--- 18 unchanged lines hidden (view full) ---

143
144#ifdef KERNEL
145int nbuf; /* The number of buffer headers */
146struct buf *buf; /* The buffer headers. */
147char *buffers; /* The buffer contents. */
148int bufpages; /* Number of memory pages in the buffer pool. */
149struct buf *swbuf; /* Swap I/O buffer headers. */
150int nswbuf; /* Number of swap I/O buffer headers. */
127
128/*
129 * This structure describes a clustered I/O. It is stored in the b_saveaddr
130 * field of the buffer on which I/O is done. At I/O completion, cluster
131 * callback uses the structure to parcel I/O's to individual buffers, and
132 * then free's this structure.
133 */
134struct cluster_save {

--- 18 unchanged lines hidden (view full) ---

153
154#ifdef KERNEL
155int nbuf; /* The number of buffer headers */
156struct buf *buf; /* The buffer headers. */
157char *buffers; /* The buffer contents. */
158int bufpages; /* Number of memory pages in the buffer pool. */
159struct buf *swbuf; /* Swap I/O buffer headers. */
160int nswbuf; /* Number of swap I/O buffer headers. */
151struct buf bswlist; /* Head of swap I/O buffer headers free list. */
161TAILQ_HEAD(swqueue, buf) bswlist;
152struct buf *bclnlist; /* Head of cleaned page list. */
153
154__BEGIN_DECLS
162struct buf *bclnlist; /* Head of cleaned page list. */
163
164__BEGIN_DECLS
155int allocbuf __P((struct buf *, int));
156int bawrite __P((struct buf *));
157int bdwrite __P((struct buf *));
165void allocbuf __P((struct buf *, int));
166void bawrite __P((struct buf *));
167void bdwrite __P((struct buf *));
158void biodone __P((struct buf *));
159int biowait __P((struct buf *));
160int bread __P((struct vnode *, daddr_t, int,
161 struct ucred *, struct buf **));
162int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
163 struct ucred *, struct buf **));
168void biodone __P((struct buf *));
169int biowait __P((struct buf *));
170int bread __P((struct vnode *, daddr_t, int,
171 struct ucred *, struct buf **));
172int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
173 struct ucred *, struct buf **));
164int brelse __P((struct buf *));
174void brelse __P((struct buf *));
165void bufinit __P((void));
166int bwrite __P((struct buf *));
167void cluster_callback __P((struct buf *));
168int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
169 struct ucred *, struct buf **));
170void cluster_write __P((struct buf *, u_quad_t));
171struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
172struct buf *geteblk __P((int));
173struct buf *getnewbuf __P((int slpflag, int slptimeo));
174struct buf *incore __P((struct vnode *, daddr_t));
175u_int minphys __P((struct buf *bp));
176__END_DECLS
177#endif
178#endif /* !_SYS_BUF_H_ */
175void bufinit __P((void));
176int bwrite __P((struct buf *));
177void cluster_callback __P((struct buf *));
178int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
179 struct ucred *, struct buf **));
180void cluster_write __P((struct buf *, u_quad_t));
181struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
182struct buf *geteblk __P((int));
183struct buf *getnewbuf __P((int slpflag, int slptimeo));
184struct buf *incore __P((struct vnode *, daddr_t));
185u_int minphys __P((struct buf *bp));
186__END_DECLS
187#endif
188#endif /* !_SYS_BUF_H_ */