Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ffs/ffs_inode.c
Show All 35 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/buf.h> | #include <sys/buf.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/racct.h> | |||||
#include <sys/random.h> | #include <sys/random.h> | ||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
▲ Show 20 Lines • Show All 561 Lines • ▼ Show 20 Lines | # define BAP(ip, i) (((ip)->i_ump->um_fstype == UFS1) ? bap1[i] : bap2[i]) | ||||
* double(triple) indirect before single(double) indirect, calls | * double(triple) indirect before single(double) indirect, calls | ||||
* to bmap on these blocks will fail. However, we already have | * to bmap on these blocks will fail. However, we already have | ||||
* the on disk address, so we have to set the b_blkno field | * the on disk address, so we have to set the b_blkno field | ||||
* explicitly instead of letting bread do everything for us. | * explicitly instead of letting bread do everything for us. | ||||
*/ | */ | ||||
vp = ITOV(ip); | vp = ITOV(ip); | ||||
bp = getblk(vp, lbn, (int)fs->fs_bsize, 0, 0, 0); | bp = getblk(vp, lbn, (int)fs->fs_bsize, 0, 0, 0); | ||||
if ((bp->b_flags & B_CACHE) == 0) { | if ((bp->b_flags & B_CACHE) == 0) { | ||||
#ifdef RACCT | |||||
if (racct_enable) { | |||||
PROC_LOCK(curproc); | |||||
racct_add_buf(curproc, bp, 0); | |||||
PROC_UNLOCK(curproc); | |||||
} | |||||
#endif /* RACCT */ | |||||
curthread->td_ru.ru_inblock++; /* pay for read */ | curthread->td_ru.ru_inblock++; /* pay for read */ | ||||
bp->b_iocmd = BIO_READ; | bp->b_iocmd = BIO_READ; | ||||
bp->b_flags &= ~B_INVAL; | bp->b_flags &= ~B_INVAL; | ||||
bp->b_ioflags &= ~BIO_ERROR; | bp->b_ioflags &= ~BIO_ERROR; | ||||
if (bp->b_bcount > bp->b_bufsize) | if (bp->b_bcount > bp->b_bufsize) | ||||
panic("ffs_indirtrunc: bad buffer size"); | panic("ffs_indirtrunc: bad buffer size"); | ||||
bp->b_blkno = dbn; | bp->b_blkno = dbn; | ||||
vfs_busy_pages(bp, 0); | vfs_busy_pages(bp, 0); | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |