vfs_cluster.c (294954) | vfs_cluster.c (297633) |
---|---|
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 --- 18 unchanged lines hidden (view full) --- 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 32 */ 33 34#include <sys/cdefs.h> | 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 --- 18 unchanged lines hidden (view full) --- 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/kern/vfs_cluster.c 294954 2016-01-27 21:23:01Z mckusick $"); | 35__FBSDID("$FreeBSD: head/sys/kern/vfs_cluster.c 297633 2016-04-07 04:23:25Z trasz $"); |
36 37#include "opt_debug_cluster.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> 42#include <sys/proc.h> 43#include <sys/bio.h> 44#include <sys/buf.h> 45#include <sys/vnode.h> 46#include <sys/malloc.h> 47#include <sys/mount.h> | 36 37#include "opt_debug_cluster.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> 42#include <sys/proc.h> 43#include <sys/bio.h> 44#include <sys/buf.h> 45#include <sys/vnode.h> 46#include <sys/malloc.h> 47#include <sys/mount.h> |
48#include <sys/racct.h> |
|
48#include <sys/resourcevar.h> 49#include <sys/rwlock.h> 50#include <sys/vmmeter.h> 51#include <vm/vm.h> 52#include <vm/vm_object.h> 53#include <vm/vm_page.h> 54#include <sys/sysctl.h> 55 --- 180 unchanged lines hidden (view full) --- 236 vfs_busy_pages(bp, 0); 237 } 238 bp->b_flags &= ~B_INVAL; 239 bp->b_ioflags &= ~BIO_ERROR; 240 if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL) 241 BUF_KERNPROC(bp); 242 bp->b_iooffset = dbtob(bp->b_blkno); 243 bstrategy(bp); | 49#include <sys/resourcevar.h> 50#include <sys/rwlock.h> 51#include <sys/vmmeter.h> 52#include <vm/vm.h> 53#include <vm/vm_object.h> 54#include <vm/vm_page.h> 55#include <sys/sysctl.h> 56 --- 180 unchanged lines hidden (view full) --- 237 vfs_busy_pages(bp, 0); 238 } 239 bp->b_flags &= ~B_INVAL; 240 bp->b_ioflags &= ~BIO_ERROR; 241 if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL) 242 BUF_KERNPROC(bp); 243 bp->b_iooffset = dbtob(bp->b_blkno); 244 bstrategy(bp); |
245#ifdef RACCT 246 if (racct_enable) { 247 PROC_LOCK(curproc); 248 racct_add_buf(curproc, bp, 0); 249 PROC_UNLOCK(curproc); 250 } 251#endif /* RACCT */ |
|
244 curthread->td_ru.ru_inblock++; 245 } 246 247 /* 248 * If we have been doing sequential I/O, then do some read-ahead. 249 */ 250 while (lblkno < (origblkno + maxra)) { 251 error = VOP_BMAP(vp, lblkno, NULL, &blkno, &ncontig, NULL); --- 37 unchanged lines hidden (view full) --- 289 vfs_busy_pages(rbp, 0); 290 } 291 rbp->b_flags &= ~B_INVAL; 292 rbp->b_ioflags &= ~BIO_ERROR; 293 if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL) 294 BUF_KERNPROC(rbp); 295 rbp->b_iooffset = dbtob(rbp->b_blkno); 296 bstrategy(rbp); | 252 curthread->td_ru.ru_inblock++; 253 } 254 255 /* 256 * If we have been doing sequential I/O, then do some read-ahead. 257 */ 258 while (lblkno < (origblkno + maxra)) { 259 error = VOP_BMAP(vp, lblkno, NULL, &blkno, &ncontig, NULL); --- 37 unchanged lines hidden (view full) --- 297 vfs_busy_pages(rbp, 0); 298 } 299 rbp->b_flags &= ~B_INVAL; 300 rbp->b_ioflags &= ~BIO_ERROR; 301 if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL) 302 BUF_KERNPROC(rbp); 303 rbp->b_iooffset = dbtob(rbp->b_blkno); 304 bstrategy(rbp); |
305#ifdef RACCT 306 if (racct_enable) { 307 PROC_LOCK(curproc); 308 racct_add_buf(curproc, rbp, 0); 309 PROC_UNLOCK(curproc); 310 } 311#endif /* RACCT */ |
|
297 curthread->td_ru.ru_inblock++; 298 } 299 300 if (reqbp) { 301 /* 302 * Like bread, always brelse() the buffer when 303 * returning an error. 304 */ --- 758 unchanged lines hidden --- | 312 curthread->td_ru.ru_inblock++; 313 } 314 315 if (reqbp) { 316 /* 317 * Like bread, always brelse() the buffer when 318 * returning an error. 319 */ --- 758 unchanged lines hidden --- |