Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_subr.c
Show First 20 Lines • Show All 4,191 Lines • ▼ Show 20 Lines | if (flags & WRITECLOSE) { | ||||
error = VOP_FSYNC(vp, MNT_WAIT, td); | error = VOP_FSYNC(vp, MNT_WAIT, td); | ||||
} while (error == ERELOOKUP); | } while (error == ERELOOKUP); | ||||
if (error != 0) { | if (error != 0) { | ||||
VOP_UNLOCK(vp); | VOP_UNLOCK(vp); | ||||
vdrop(vp); | vdrop(vp); | ||||
MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); | MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); | ||||
return (error); | return (error); | ||||
} | } | ||||
error = VOP_GETATTR(vp, &vattr, td->td_ucred); | error = VOP_GETATTR(vp, 0, &vattr, td->td_ucred); | ||||
VI_LOCK(vp); | VI_LOCK(vp); | ||||
if ((vp->v_type == VNON || | if ((vp->v_type == VNON || | ||||
(error == 0 && vattr.va_nlink > 0)) && | (error == 0 && vattr.va_nlink > 0)) && | ||||
(vp->v_writecount <= 0 || vp->v_type != VREG)) { | (vp->v_writecount <= 0 || vp->v_type != VREG)) { | ||||
VOP_UNLOCK(vp); | VOP_UNLOCK(vp); | ||||
vdropl(vp); | vdropl(vp); | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 3,109 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
vn_getsize_locked(struct vnode *vp, off_t *size, struct ucred *cred) | vn_getsize_locked(struct vnode *vp, off_t *size, struct ucred *cred) | ||||
{ | { | ||||
struct vattr vattr; | struct vattr vattr; | ||||
int error; | int error; | ||||
ASSERT_VOP_LOCKED(vp, __func__); | ASSERT_VOP_LOCKED(vp, __func__); | ||||
error = VOP_GETATTR(vp, &vattr, cred); | error = VOP_GETATTR(vp, 0, &vattr, cred); | ||||
if (__predict_true(error == 0)) { | if (__predict_true(error == 0)) { | ||||
if (vattr.va_size <= OFF_MAX) | if (vattr.va_size <= OFF_MAX) | ||||
*size = vattr.va_size; | *size = vattr.va_size; | ||||
else | else | ||||
error = EFBIG; | error = EFBIG; | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |