vfs_cluster.c (48545) | vfs_cluster.c (48677) |
---|---|
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.85 1999/06/29 05:59:43 peter Exp $ | 36 * $Id: vfs_cluster.c,v 1.86 1999/07/04 00:31:17 mckusick Exp $ |
37 */ 38 39#include "opt_debug_cluster.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/proc.h> --- 100 unchanged lines hidden (view full) --- 145 s = splbio(); 146 for (i = 1; i < maxra; i++) { 147 148 if (!(tbp = incore(vp, lblkno+i))) { 149 break; 150 } 151 152 /* | 37 */ 38 39#include "opt_debug_cluster.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/proc.h> --- 100 unchanged lines hidden (view full) --- 145 s = splbio(); 146 for (i = 1; i < maxra; i++) { 147 148 if (!(tbp = incore(vp, lblkno+i))) { 149 break; 150 } 151 152 /* |
153 * Set another read-ahead mark so we know to check 154 * again. | 153 * Set another read-ahead mark so we know 154 * to check again. |
155 */ 156 if (((i % racluster) == (racluster - 1)) || 157 (i == (maxra - 1))) 158 tbp->b_flags |= B_RAM; | 155 */ 156 if (((i % racluster) == (racluster - 1)) || 157 (i == (maxra - 1))) 158 tbp->b_flags |= B_RAM; |
159 160#if 0 161 if ((tbp->b_usecount < 1) && 162 BUF_REFCNT(tbp) == 0 && 163 (tbp->b_qindex == QUEUE_LRU)) { 164 TAILQ_REMOVE(&bufqueues[QUEUE_LRU], tbp, b_freelist); 165 TAILQ_INSERT_TAIL(&bufqueues[QUEUE_LRU], tbp, b_freelist); 166 } 167#endif | |
168 } 169 splx(s); 170 if (i >= maxra) { 171 return 0; 172 } 173 lblkno += i; 174 } 175 reqbp = bp = NULL; --- 405 unchanged lines hidden (view full) --- 581 * write, or we have reached our maximum cluster size, 582 * then push the previous cluster. Otherwise try 583 * reallocating to make it sequential. 584 */ 585 cursize = vp->v_lastw - vp->v_cstart + 1; 586 if (((u_quad_t) bp->b_offset + lblocksize) != filesize || 587 lbn != vp->v_lastw + 1 || vp->v_clen <= cursize) { 588 if (!async) | 159 } 160 splx(s); 161 if (i >= maxra) { 162 return 0; 163 } 164 lblkno += i; 165 } 166 reqbp = bp = NULL; --- 405 unchanged lines hidden (view full) --- 572 * write, or we have reached our maximum cluster size, 573 * then push the previous cluster. Otherwise try 574 * reallocating to make it sequential. 575 */ 576 cursize = vp->v_lastw - vp->v_cstart + 1; 577 if (((u_quad_t) bp->b_offset + lblocksize) != filesize || 578 lbn != vp->v_lastw + 1 || vp->v_clen <= cursize) { 579 if (!async) |
589 cluster_wbuild(vp, lblocksize, | 580 cluster_wbuild_wb(vp, lblocksize, |
590 vp->v_cstart, cursize); 591 } else { 592 struct buf **bpp, **endbp; 593 struct cluster_save *buflist; 594 595 buflist = cluster_collectbufs(vp, bp); 596 endbp = &buflist->bs_children 597 [buflist->bs_nchildren - 1]; --- 292 unchanged lines hidden --- | 581 vp->v_cstart, cursize); 582 } else { 583 struct buf **bpp, **endbp; 584 struct cluster_save *buflist; 585 586 buflist = cluster_collectbufs(vp, bp); 587 endbp = &buflist->bs_children 588 [buflist->bs_nchildren - 1]; --- 292 unchanged lines hidden --- |