|
NAMEVOP_READ_PGCACHE —
read a file, fast
SYNOPSIS#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/uio.h>
int
DESCRIPTIONThis entry point reads the contents of a file. The intent is to provide the data from caches, which do not require expensive operations or any disk IO. For instance, if filesystem uses normal VM page cache and maintainsv_object lifetime, it can use
vn_read_from_obj(9)
helper to return data from the resident
vp->v_object pages.
The filesystem indicates support for the
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,
The VFS layer does the same deadlock avoidance for accessing
userspace pages from 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 The arguments are:
LOCKSThe file should be referenced on entry on entry and will still be referenced on exit. Rangelock covering the whole read range should be owned around the call.RETURN VALUESZero is returned on success, when the whole request is satisfied, and no more data cannot be provided for it by any means. If more data can be returned, butVOP_READ_PGCACHE was unable to provide it,
EJUSTRETURN must be returned. The
uio records should be updated according to the partial
operation done.
Otherwise an error code is returned, same as from VOP_READ(9) SEE ALSOuiomove(9), vnode(9), VOP_READ(9)
Visit the GSP FreeBSD Man Page Interface. |