From 3c484f325e60e961c476dfb6ebd992290667d6dd Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 15 Sep 2020 22:06:36 +0000 Subject: Convert page cache read to VOP. There are several negative side-effects of not calling into VOP layer at all for page cache reads. The biggest is the missed activation of EVFILT_READ knotes. Also, it allows filesystem to make more fine grained decision to refuse read from page cache. Keep VIRF_PGREAD flag around, it is still useful for nullfs, and for asserts. Reviewed by: markj Tested by: pho Discussed with: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 --- sys/kern/vfs_subr.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/kern/vfs_subr.c') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 34f35f3638d0..6956a8f55e89 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5838,6 +5838,15 @@ vop_read_post(void *ap, int rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); } +void +vop_read_pgcache_post(void *ap, int rc) +{ + struct vop_read_pgcache_args *a = ap; + + if (!rc) + VFS_KNOTE_UNLOCKED(a->a_vp, NOTE_READ); +} + void vop_readdir_post(void *ap, int rc) { -- cgit v1.2.3