/* vn_open gives both long- and short-term references */
error = vn_open(&nd, flags, 0);
if (error) {
/* vn_open gives both long- and short-term references */
error = vn_open(&nd, flags, 0);
if (error) {
flags &= ~FWRITE;
if (in_kernel) {
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE32,
flags &= ~FWRITE;
if (in_kernel) {
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE32,
vniop->vn_file, &context);
}
error = vn_open(&nd, flags, 0);
vniop->vn_file, &context);
}
error = vn_open(&nd, flags, 0);
- (void) vn_close(nd.ni_vp, flags, proc_ucred(p), p);
+ (void) vn_close(nd.ni_vp, flags, context.vc_ucred, p);
return (error);
}
cred = kauth_cred_proc_ref(p);
nd.ni_vp->v_flag |= VNOCACHE_DATA;
error = setcred(nd.ni_vp, p, cred);
if (error) {
return (error);
}
cred = kauth_cred_proc_ref(p);
nd.ni_vp->v_flag |= VNOCACHE_DATA;
error = setcred(nd.ni_vp, p, cred);
if (error) {
- (void)vn_close(nd.ni_vp, flags, proc_ucred(p), p);
+ (void)vn_close(nd.ni_vp, flags, context.vc_ucred, p);
error = vn_open(&nd, flags, 0);
if (error) {
/* shadow MUST be writable! */
error = vn_open(&nd, flags, 0);
if (error) {
/* shadow MUST be writable! */
return (error);
}
if (nd.ni_vp->v_type != VREG
|| (error = vnode_size(nd.ni_vp, &file_size, &context))) {
return (error);
}
if (nd.ni_vp->v_type != VREG
|| (error = vnode_size(nd.ni_vp, &file_size, &context))) {
- (void)vn_close(nd.ni_vp, flags, proc_ucred(p), p);
+ (void)vn_close(nd.ni_vp, flags, context.vc_ucred, p);
return (error ? error : EINVAL);
}
map = shadow_map_create(vn->sc_fsize, file_size,
0, vn->sc_secsize);
if (map == NULL) {
return (error ? error : EINVAL);
}
map = shadow_map_create(vn->sc_fsize, file_size,
0, vn->sc_secsize);
if (map == NULL) {
- (void)vn_close(nd.ni_vp, flags, proc_ucred(p), p);
+ (void)vn_close(nd.ni_vp, flags, context.vc_ucred, p);