xref: /original-bsd/sys/kern/PROTO/44Lite/vfs_bio.c (revision a91856c6)
1 /*
2  * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	from: @(#)vfs_bio.c	7.40 (Berkeley) 5/8/91
8  */
9 
10 #include "param.h"
11 #include "proc.h"
12 #include "buf.h"
13 #include "vnode.h"
14 #include "specdev.h"
15 #include "mount.h"
16 #include "trace.h"
17 #include "resourcevar.h"
18 
19 /*
20  * Initialize buffers and hash links for buffers.
21  */
22 bufinit()
23 {
24 
25 	/*
26 	 * Body deleted.
27 	 */
28 	return;
29 }
30 
31 /*
32  * Find the block in the buffer pool.
33  * If the buffer is not present, allocate a new buffer and load
34  * its contents according to the filesystem fill routine.
35  */
36 bread(vp, blkno, size, cred, bpp)
37 	struct vnode *vp;
38 	daddr_t blkno;
39 	int size;
40 	struct ucred *cred;
41 	struct buf **bpp;
42 {
43 
44 	/*
45 	 * Body deleted.
46 	 */
47 	return (EIO);
48 }
49 
50 /*
51  * Operates like bread, but also starts I/O on the specified
52  * read-ahead block.
53  */
54 breada(vp, blkno, size, rablkno, rabsize, cred, bpp)
55 	struct vnode *vp;
56 	daddr_t blkno; int size;
57 	daddr_t rablkno; int rabsize;
58 	struct ucred *cred;
59 	struct buf **bpp;
60 {
61 
62 	/*
63 	 * Body deleted.
64 	 */
65 	return (EIO);
66 }
67 
68 /*
69  * Synchronous write.
70  * Release buffer on completion.
71  */
72 bwrite(bp)
73 	register struct buf *bp;
74 {
75 
76 	/*
77 	 * Body deleted.
78 	 */
79 	return (EIO);
80 }
81 
82 /*
83  * Delayed write.
84  *
85  * The buffer is marked dirty, but is not queued for I/O.
86  * This routine should be used when the buffer is expected
87  * to be modified again soon, typically a small write that
88  * partially fills a buffer.
89  *
90  * NB: magnetic tapes cannot be delayed; they must be
91  * written in the order that the writes are requested.
92  */
93 bdwrite(bp)
94 	register struct buf *bp;
95 {
96 
97 	/*
98 	 * Body deleted.
99 	 */
100 	return;
101 }
102 
103 /*
104  * Asynchronous write.
105  * Start I/O on a buffer, but do not wait for it to complete.
106  * The buffer is released when the I/O completes.
107  */
108 bawrite(bp)
109 	register struct buf *bp;
110 {
111 
112 	/*
113 	 * Body deleted.
114 	 */
115 	return;
116 }
117 
118 /*
119  * Release a buffer.
120  * Even if the buffer is dirty, no I/O is started.
121  */
122 brelse(bp)
123 	register struct buf *bp;
124 {
125 
126 	/*
127 	 * Body deleted.
128 	 */
129 	return;
130 }
131 
132 /*
133  * Check to see if a block is currently memory resident.
134  */
135 incore(vp, blkno)
136 	struct vnode *vp;
137 	daddr_t blkno;
138 {
139 
140 	/*
141 	 * Body deleted.
142 	 */
143 	return (0);
144 }
145 
146 /*
147  * Check to see if a block is currently memory resident.
148  * If it is resident, return it. If it is not resident,
149  * allocate a new buffer and assign it to the block.
150  */
151 struct buf *
152 getblk(vp, blkno, size)
153 	register struct vnode *vp;
154 	daddr_t blkno;
155 	int size;
156 {
157 
158 	/*
159 	 * Body deleted.
160 	 */
161 	return (0);
162 }
163 
164 /*
165  * Allocate a buffer.
166  * The caller will assign it to a block.
167  */
168 struct buf *
169 geteblk(size)
170 	int size;
171 {
172 
173 	/*
174 	 * Body deleted.
175 	 */
176 	return (0);
177 }
178 
179 /*
180  * Expand or contract the actual memory allocated to a buffer.
181  * If no memory is available, release buffer and take error exit.
182  */
183 allocbuf(tp, size)
184 	register struct buf *tp;
185 	int size;
186 {
187 
188 	/*
189 	 * Body deleted.
190 	 */
191 	return (0);
192 }
193 
194 /*
195  * Find a buffer which is available for use.
196  * Select something from a free list.
197  * Preference is to AGE list, then LRU list.
198  */
199 struct buf *
200 getnewbuf()
201 {
202 
203 	/*
204 	 * Body deleted.
205 	 */
206 	return (0);
207 }
208 
209 /*
210  * Wait for I/O to complete.
211  *
212  * Extract and return any errors associated with the I/O.
213  * If the error flag is set, but no specific error is
214  * given, return EIO.
215  */
216 biowait(bp)
217 	register struct buf *bp;
218 {
219 
220 	/*
221 	 * Body deleted.
222 	 */
223 	return (EIO);
224 }
225 
226 /*
227  * Mark I/O complete on a buffer.
228  *
229  * If a callback has been requested, e.g. the pageout
230  * daemon, do so. Otherwise, awaken waiting processes.
231  */
232 biodone(bp)
233 	register struct buf *bp;
234 {
235 
236 	/*
237 	 * Body deleted.
238 	 */
239 	 return;
240 }
241