vfs_cluster.c (13666) | vfs_cluster.c (14319) |
---|---|
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.33 1996/01/20 23:24:16 dyson Exp $ | 36 * $Id: vfs_cluster.c,v 1.34 1996/01/28 18:25:54 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> --- 244 unchanged lines hidden (view full) --- 289 /* 290 * avoid a division 291 */ 292 while ((u_quad_t) size * (lbn + run) > filesize) { 293 --run; 294 } 295 296 tbp = getblk(vp, lbn, size, 0, 0); | 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> --- 244 unchanged lines hidden (view full) --- 289 /* 290 * avoid a division 291 */ 292 while ((u_quad_t) size * (lbn + run) > filesize) { 293 --run; 294 } 295 296 tbp = getblk(vp, lbn, size, 0, 0); |
297 if (tbp->b_flags & B_CACHE) | 297 if (tbp->b_flags & (B_CACHE|B_MALLOC)) |
298 return tbp; 299 300 tbp->b_blkno = blkno; 301 tbp->b_flags |= B_ASYNC | B_READ; 302 if( ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) 303 return tbp; 304 305 bp = trypbuf(); --- 280 unchanged lines hidden (view full) --- 586 587 /* 588 * Extra memory in the buffer, punt on this buffer. XXX we could 589 * handle this in most cases, but we would have to push the extra 590 * memory down to after our max possible cluster size and then 591 * potentially pull it back up if the cluster was terminated 592 * prematurely--too much hassle. 593 */ | 298 return tbp; 299 300 tbp->b_blkno = blkno; 301 tbp->b_flags |= B_ASYNC | B_READ; 302 if( ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) 303 return tbp; 304 305 bp = trypbuf(); --- 280 unchanged lines hidden (view full) --- 586 587 /* 588 * Extra memory in the buffer, punt on this buffer. XXX we could 589 * handle this in most cases, but we would have to push the extra 590 * memory down to after our max possible cluster size and then 591 * potentially pull it back up if the cluster was terminated 592 * prematurely--too much hassle. 593 */ |
594 if (((tbp->b_flags & B_CLUSTEROK) != B_CLUSTEROK) || | 594 if (((tbp->b_flags & (B_CLUSTEROK|B_MALLOC)) != B_CLUSTEROK) || |
595 (tbp->b_bcount != tbp->b_bufsize) || 596 (tbp->b_bcount != size) || 597 len == 1) { 598 totalwritten += tbp->b_bufsize; 599 bawrite(tbp); 600 ++start_lbn; 601 --len; 602 continue; --- 109 unchanged lines hidden --- | 595 (tbp->b_bcount != tbp->b_bufsize) || 596 (tbp->b_bcount != size) || 597 len == 1) { 598 totalwritten += tbp->b_bufsize; 599 bawrite(tbp); 600 ++start_lbn; 601 --len; 602 continue; --- 109 unchanged lines hidden --- |