| Main index | Section 9 | Options | 
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/uio.h>
The filesystem indicates support for the VOP_READ_PGCACHE on specific vnode by setting the VIRF_PGREAD flag in vp->v_irflag.
The function does not need to satisfy the whole request; it also might choose to not provide any data. In these cases, the uio must be advanced by the amount of read data, VOP_READ_PGCACHE should return EJUSTRETURN, and VFS would handle the rest of the read operation using the VOP_READ(9).
The VFS layer does the same deadlock avoidance for accessing userspace pages from VOP_READ_PGCACHE as for VOP_READ(9).
Vnode is not locked on the call entry and should not be locked on return. For a filesystem that requires vnode lock to return any data, it does not make sense to implement VOP_READ_PGCACHE (and set VIRF_PGREAD flag) since VFS arranges the call to VOP_READ(9) as needed.
The arguments are:
| vp | |
| The vnode of the file. | |
| uio | |
| The location of the data to be read. | |
| ioflag | |
| Various flags, see VOP_READ(9) for the list. | |
| cred | |
| The credentials of the caller. | |
VOP_READ_PGCACHE does not handle non-zero ioflag argument.
Otherwise an error code is returned, same as from VOP_READ(9)
| VOP_READ_PGCACHE (9) | February 28, 2021 | 
| Main index | Section 9 | Options | 
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | The last good thing written in C was Franz Schubert's Symphony #9. | ” | 
| — Erwin Dietrich | ||