void vn_reinit(vnode_t *vp) { vp->v_vfsp = NULL; vp->v_fd = -1; vp->v_size = 0; vp->v_count = 1; vn_recycle(vp); }
/* * Used to reset the vnode fields including those that are directly accessible * as well as those which require an accessor function. * * Does not initialize: * synchronization objects: v_lock, v_vsd_lock, v_nbllock, v_cv * v_data (since FS-nodes and vnodes point to each other and should * be updated simultaneously) * v_op (in case someone needs to make a VOP call on this object) */ void vn_reinit(vnode_t *vp) { vp->v_count = 1; vp->v_vfsp = NULL; vp->v_stream = NULL; vp->v_flag = 0; vp->v_type = VNON; vp->v_rdev = NODEV; vn_recycle(vp); }