Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_cluster.c
Show All 39 Lines | |||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/buf.h> | #include <sys/buf.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <sys/racct.h> | |||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | if ((bp->b_flags & B_CLUSTER) == 0) { | ||||
vfs_busy_pages(bp, 0); | vfs_busy_pages(bp, 0); | ||||
} | } | ||||
bp->b_flags &= ~B_INVAL; | bp->b_flags &= ~B_INVAL; | ||||
bp->b_ioflags &= ~BIO_ERROR; | bp->b_ioflags &= ~BIO_ERROR; | ||||
if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL) | if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL) | ||||
BUF_KERNPROC(bp); | BUF_KERNPROC(bp); | ||||
bp->b_iooffset = dbtob(bp->b_blkno); | bp->b_iooffset = dbtob(bp->b_blkno); | ||||
bstrategy(bp); | bstrategy(bp); | ||||
#ifdef RACCT | |||||
if (racct_enable) { | |||||
PROC_LOCK(curproc); | |||||
racct_add_buf(curproc, bp, 0); | |||||
PROC_UNLOCK(curproc); | |||||
} | |||||
#endif /* RACCT */ | |||||
curthread->td_ru.ru_inblock++; | curthread->td_ru.ru_inblock++; | ||||
} | } | ||||
/* | /* | ||||
* If we have been doing sequential I/O, then do some read-ahead. | * If we have been doing sequential I/O, then do some read-ahead. | ||||
*/ | */ | ||||
while (lblkno < (origblkno + maxra)) { | while (lblkno < (origblkno + maxra)) { | ||||
error = VOP_BMAP(vp, lblkno, NULL, &blkno, &ncontig, NULL); | error = VOP_BMAP(vp, lblkno, NULL, &blkno, &ncontig, NULL); | ||||
Show All 37 Lines | if ((rbp->b_flags & B_CLUSTER) == 0) { | ||||
vfs_busy_pages(rbp, 0); | vfs_busy_pages(rbp, 0); | ||||
} | } | ||||
rbp->b_flags &= ~B_INVAL; | rbp->b_flags &= ~B_INVAL; | ||||
rbp->b_ioflags &= ~BIO_ERROR; | rbp->b_ioflags &= ~BIO_ERROR; | ||||
if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL) | if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL) | ||||
BUF_KERNPROC(rbp); | BUF_KERNPROC(rbp); | ||||
rbp->b_iooffset = dbtob(rbp->b_blkno); | rbp->b_iooffset = dbtob(rbp->b_blkno); | ||||
bstrategy(rbp); | bstrategy(rbp); | ||||
#ifdef RACCT | |||||
if (racct_enable) { | |||||
PROC_LOCK(curproc); | |||||
racct_add_buf(curproc, rbp, 0); | |||||
PROC_UNLOCK(curproc); | |||||
} | |||||
#endif /* RACCT */ | |||||
curthread->td_ru.ru_inblock++; | curthread->td_ru.ru_inblock++; | ||||
} | } | ||||
if (reqbp) { | if (reqbp) { | ||||
/* | /* | ||||
* Like bread, always brelse() the buffer when | * Like bread, always brelse() the buffer when | ||||
* returning an error. | * returning an error. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 758 Lines • Show Last 20 Lines |