VNOP_READ
Call down to a filesystem to read file data.
Declaration
errno_t VNOP_READ(vnode_t vp, struct uio *uio, int ioflag, vfs_context_t ctx);Parameters
- vp:
The vnode to read from.
- uio:
Description of request, including file offset, amount of data requested, destination address for data, and whether that destination is in kernel or user space.
- ctx:
Context against which to authenticate read request.
Return Value
0 for success or a filesystem-specific error. VNOP_READ() can return success even if less data was read than originally requested; returning an error value should indicate that something actually went wrong.
Discussion
VNOP_READ() is where the hard work of of the read() system call happens. The filesystem may use the buffer cache, the cluster layer, or an alternative method to get its data; uio routines will be used to see that data is copied to the correct virtual address in the correct address space and will update its uio argument to indicate how much data has been moved.
See Also
Support
nop_accessnop_advlocknop_allocatenop_blktooffnop_blockmapnop_bwritenop_closenop_copyfilenop_createnop_exchangenop_fsyncnop_getattrnop_inactivenop_ioctlnop_linknop_mkdirnop_mknodnop_mmapnop_offtoblknop_opennop_pageinnop_pageoutnop_pathconfnop_readnop_readdirnop_readdirattrnop_readlinknop_reclaimnop_removenop_renamenop_revokenop_rmdirnop_searchfsnop_selectnop_setattrnop_strategynop_symlinknop_whiteoutnop_writeerr_accesserr_advlockerr_allocateerr_blktoofferr_blockmaperr_bwriteerr_closeerr_copyfileerr_createerr_exchangeerr_fsyncerr_getattrerr_inactiveerr_ioctlerr_linkerr_mkdirerr_mknoderr_mmaperr_offtoblkerr_openerr_pageinerr_pageouterr_pathconferr_readerr_readdirerr_readdirattrerr_readlinkerr_reclaimerr_removeerr_renameerr_revokeerr_rmdirerr_searchfserr_selecterr_setattrerr_strategyerr_symlinkerr_whiteouterr_writeadvisory_readadvisory_read_extVNOP_BWRITEVNOP_FSYNCVNOP_GETXATTRVNOP_IOCTLVNOP_SETXATTRVNOP_STRATEGYVNOP_WRITEcache_entercache_lookupcache_purgecache_purge_negatives