Deleted Added
full compact
vfs_cluster.c (10545) vfs_cluster.c (10551)
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 * Modifications/enhancements:
5 * Copyright (c) 1995 John S. Dyson. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 * Modifications/enhancements:
5 * Copyright (c) 1995 John S. Dyson. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
36 * $Id: vfs_cluster.c,v 1.18 1995/09/03 19:56:15 dyson Exp $
36 * $Id: vfs_cluster.c,v 1.19 1995/09/03 20:32:52 dyson Exp $
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/proc.h>
42#include <sys/buf.h>
43#include <sys/vnode.h>
44#include <sys/mount.h>

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

209 }
210 }
211 /*
212 * we now build the read-ahead buffer if it is desirable.
213 */
214 rbp = NULL;
215 if (!alreadyincore &&
216 (rablkno + 1) * size <= filesize &&
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/proc.h>
42#include <sys/buf.h>
43#include <sys/vnode.h>
44#include <sys/mount.h>

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

209 }
210 }
211 /*
212 * we now build the read-ahead buffer if it is desirable.
213 */
214 rbp = NULL;
215 if (!alreadyincore &&
216 (rablkno + 1) * size <= filesize &&
217 !(error = VOP_BMAP(vp, rablkno, NULL, &blkno, &num_ra)) &&
217 !(error = VOP_BMAP(vp, rablkno, NULL, &blkno, &num_ra, NULL)) &&
218 blkno != -1) {
219 if (num_ra > vp->v_ralen)
220 num_ra = vp->v_ralen;
221
222 if (num_ra) {
223 rbp = cluster_rbuild(vp, filesize, rablkno, blkno, size,
224 num_ra + 1);
225 } else {

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

500 }
501 /*
502 * Consider beginning a cluster. If at end of file, make
503 * cluster as large as possible, otherwise find size of
504 * existing cluster.
505 */
506 if ((lbn + 1) * lblocksize != filesize &&
507 (bp->b_blkno == bp->b_lblkno) &&
218 blkno != -1) {
219 if (num_ra > vp->v_ralen)
220 num_ra = vp->v_ralen;
221
222 if (num_ra) {
223 rbp = cluster_rbuild(vp, filesize, rablkno, blkno, size,
224 num_ra + 1);
225 } else {

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

500 }
501 /*
502 * Consider beginning a cluster. If at end of file, make
503 * cluster as large as possible, otherwise find size of
504 * existing cluster.
505 */
506 if ((lbn + 1) * lblocksize != filesize &&
507 (bp->b_blkno == bp->b_lblkno) &&
508 (VOP_BMAP(vp, lbn, NULL, &bp->b_blkno, &maxclen) ||
508 (VOP_BMAP(vp, lbn, NULL, &bp->b_blkno, &maxclen, NULL) ||
509 bp->b_blkno == -1)) {
510 bawrite(bp);
511 vp->v_clen = 0;
512 vp->v_lasta = bp->b_blkno;
513 vp->v_cstart = lbn + 1;
514 vp->v_lastw = lbn;
515 return;
516 }

--- 224 unchanged lines hidden ---
509 bp->b_blkno == -1)) {
510 bawrite(bp);
511 vp->v_clen = 0;
512 vp->v_lasta = bp->b_blkno;
513 vp->v_cstart = lbn + 1;
514 vp->v_lastw = lbn;
515 return;
516 }

--- 224 unchanged lines hidden ---