Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
Show First 20 Lines • Show All 5,200 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
error = vn_open_cred(&nd, &flags, 0, VN_OPEN_INVFS, ap->a_cred, NULL); | error = vn_open_cred(&nd, &flags, 0, VN_OPEN_INVFS, ap->a_cred, NULL); | ||||
if (error != 0) | if (error != 0) | ||||
return (SET_ERROR(error)); | return (SET_ERROR(error)); | ||||
vp = nd.ni_vp; | vp = nd.ni_vp; | ||||
NDFREE_PNBUF(&nd); | NDFREE_PNBUF(&nd); | ||||
if (ap->a_size != NULL) { | if (ap->a_size != NULL) { | ||||
error = VOP_GETATTR(vp, &va, ap->a_cred); | error = VOP_GETATTR(vp, 0, &va, ap->a_cred); | ||||
if (error == 0) | if (error == 0) | ||||
*ap->a_size = (size_t)va.va_size; | *ap->a_size = (size_t)va.va_size; | ||||
} else if (ap->a_uio != NULL) | } else if (ap->a_uio != NULL) | ||||
error = VOP_READ(vp, ap->a_uio, IO_UNIT, ap->a_cred); | error = VOP_READ(vp, ap->a_uio, IO_UNIT, ap->a_cred); | ||||
VOP_UNLOCK(vp); | VOP_UNLOCK(vp); | ||||
vn_close(vp, flags, ap->a_cred, td); | vn_close(vp, flags, ap->a_cred, td); | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 1,033 Lines • Show Last 20 Lines |