path: root/sys/sys/vnode.h
diff options
authorKonstantin Belousov <kib@FreeBSD.org>2020-08-16 21:02:45 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-08-16 21:02:45 +0000
commitfbca789fc328487a1be438f5235e4c0ad0eb849b (patch)
treee3ef97c76f97aa02509828b92b74d76c67945e68 /sys/sys/vnode.h
parentffae7ea93529250758d77eb899bd9b42faeb980f (diff)
VMIO read
If possible, i.e. if the requested range is resident valid in the vm object queue, and some secondary conditions hold, copy data for read(2) directly from the valid cached pages, avoiding vnode lock and instantiating buffers. I intentionally do not start read-ahead, nor handle the advises on the cached range. Filesystems indicate support for VMIO reads by setting VIRF_PGREAD flag, which must not be cleared until vnode reclamation. Currently only filesystems that use vnode pager for v_objects can enable it, due to reliance on vnp_size. There is a WIP to handle it for tmpfs. Reviewed by: markj Discussed with: jeff Tested by: pho Benchmarked by: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25968
Notes: svn path=/head/; revision=364287
Diffstat (limited to 'sys/sys/vnode.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index f0576bb094ed..ef58d54d0b47 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -244,6 +244,8 @@ struct xvnode {
#define VIRF_DOOMED 0x0001 /* This vnode is being recycled */
+#define VIRF_PGREAD 0x0002 /* Direct reads from the page cache are permitted,
+ never cleared once set */
#define VI_TEXT_REF 0x0001 /* Text ref grabbed use ref */
#define VI_MOUNT 0x0002 /* Mount in progress */