Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_vnops.c
Show First 20 Lines • Show All 985 Lines • ▼ Show 20 Lines | vn_read(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, | ||||
if (fp->f_flag & O_DIRECT) | if (fp->f_flag & O_DIRECT) | ||||
ioflag |= IO_DIRECT; | ioflag |= IO_DIRECT; | ||||
/* | /* | ||||
* Try to read from page cache. VIRF_DOOMED check is racy but | * Try to read from page cache. VIRF_DOOMED check is racy but | ||||
* allows us to avoid unneeded work outright. | * allows us to avoid unneeded work outright. | ||||
*/ | */ | ||||
if (vn_io_pgcache_read_enable && !mac_vnode_check_read_enabled() && | if (vn_io_pgcache_read_enable && !mac_vnode_check_read_enabled() && | ||||
(vp->v_irflag & (VIRF_DOOMED | VIRF_PGREAD)) == VIRF_PGREAD) { | (vn_irflag_read(vp) & (VIRF_DOOMED | VIRF_PGREAD)) == VIRF_PGREAD) { | ||||
error = VOP_READ_PGCACHE(vp, uio, ioflag, fp->f_cred); | error = VOP_READ_PGCACHE(vp, uio, ioflag, fp->f_cred); | ||||
if (error == 0) { | if (error == 0) { | ||||
fp->f_nextoff[UIO_READ] = uio->uio_offset; | fp->f_nextoff[UIO_READ] = uio->uio_offset; | ||||
return (0); | return (0); | ||||
} | } | ||||
if (error != EJUSTRETURN) | if (error != EJUSTRETURN) | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 991 Lines • Show Last 20 Lines |