Lines Matching full:vnode

48 #include <sys/vnode.h>
69 MALLOC_DEFINE(M_UNIONFSNODE, "UNIONFS node", "UNIONFS vnode private part");
80 &unionfs_ndeferred, 0, "unionfs deferred vnode release");
132 unionfs_get_hashhead(struct vnode *dvp, struct vnode *lookup) in unionfs_get_hashhead()
142 * Attempt to lookup a cached unionfs vnode by upper/lower vp
145 static struct vnode *
146 unionfs_get_cached_vnode_locked(struct vnode *lookup, struct vnode *dvp) in unionfs_get_cached_vnode_locked()
150 struct vnode *vp; in unionfs_get_cached_vnode_locked()
177 * Get the cached vnode.
179 static struct vnode *
180 unionfs_get_cached_vnode(struct vnode *uvp, struct vnode *lvp, in unionfs_get_cached_vnode()
181 struct vnode *dvp) in unionfs_get_cached_vnode()
183 struct vnode *vp; in unionfs_get_cached_vnode()
197 * Add the new vnode into cache.
199 static struct vnode *
201 struct vnode *dvp) in unionfs_ins_cached_vnode()
204 struct vnode *vp; in unionfs_ins_cached_vnode()
230 * Remove the vnode.
233 unionfs_rem_cached_vnode(struct unionfs_node *unp, struct vnode *dvp) in unionfs_rem_cached_vnode()
237 ("%s: null parent vnode", __func__)); in unionfs_rem_cached_vnode()
256 unionfs_nodeget_cleanup(struct vnode *vp, struct unionfs_node *unp) in unionfs_nodeget_cleanup()
260 * Lock and reset the default vnode lock; vgone() expects a locked in unionfs_nodeget_cleanup()
261 * vnode, and we're going to reset the vnode ops. in unionfs_nodeget_cleanup()
266 * Clear out private data and reset the vnode ops to avoid use of in unionfs_nodeget_cleanup()
267 * unionfs vnode ops on a partially constructed vnode. in unionfs_nodeget_cleanup()
294 * uppervp and lowervp should be unlocked. Because if new unionfs vnode is
299 unionfs_nodeget(struct mount *mp, struct vnode *uppervp, in unionfs_nodeget()
300 struct vnode *lowervp, struct vnode *dvp, struct vnode **vpp, in unionfs_nodeget()
306 struct vnode *vp; in unionfs_nodeget()
381 * the underlying filesystems will always return vnode pointers in unionfs_nodeget()
384 * vnode has been forcibly doomed, we check both pointers and set in unionfs_nodeget()
395 * If dvp has an upper FS component and is locked, while the new vnode in unionfs_nodeget()
400 * a child vnode lock is taken while holding a lock on its parent in unionfs_nodeget()
423 * lock on the new unionfs vnode at this point. Therefore, if a in unionfs_nodeget()
426 * blocked on our vnode lock, effectively also preventing unmount in unionfs_nodeget()
458 unionfs_noderem(struct vnode *vp) in unionfs_noderem()
463 struct vnode *lvp; in unionfs_noderem()
464 struct vnode *uvp; in unionfs_noderem()
465 struct vnode *dvp; in unionfs_noderem()
471 * The root vnode lock may be recursed during unmount, because in unionfs_noderem()
472 * it may share the same lock as the unionfs mount's covered vnode, in unionfs_noderem()
476 * one of those lock operations was taken against a unionfs vnode and in unionfs_noderem()
477 * will be undone against a unionfs vnode. in unionfs_noderem()
480 ("%s: vnode %p locked recursively", __func__, vp)); in unionfs_noderem()
490 * Lock the lower vnode in addition to the upper vnode lock in order in unionfs_noderem()
492 * hold the lower vnode lock. We do not need to do this for the root in unionfs_noderem()
493 * vnode, as the root vnode should always have both upper and lower in unionfs_noderem()
495 * never attempt to lock its lower vnode in the first place. in unionfs_noderem()
497 * root vnode will already be locked as it is the covered vnode. in unionfs_noderem()
505 panic("%s: failed to acquire lock for vnode lock", __func__); in unionfs_noderem()
518 * be necessary during forced unmount, when the vnode may in unionfs_noderem()
538 * to the lower vnode. If this is a reclamation due to the in unionfs_noderem()
543 ("%s: write reference without upper vnode", __func__)); in unionfs_noderem()
581 * Find the unionfs node status object for the vnode corresponding to unp,
605 * Get the unionfs node status object for the vnode corresponding to unp,
635 * You need exclusive lock this vnode.
696 unionfs_create_uppervattr(struct unionfs_mount *ump, struct vnode *lvp, in unionfs_create_uppervattr()
716 * locked, referenced vnode. If *vpp == dvp then remember that only one
720 unionfs_relookup(struct vnode *dvp, struct vnode **vpp, in unionfs_relookup()
760 * uvp is new locked upper vnode. unionfs vnode's lock will be exchanged to the
764 unionfs_node_update(struct unionfs_node *unp, struct vnode *uvp, in unionfs_node_update()
768 struct vnode *vp; in unionfs_node_update()
769 struct vnode *lvp; in unionfs_node_update()
770 struct vnode *dvp; in unionfs_node_update()
782 * Update the upper vnode's lock state to match the lower vnode, in unionfs_node_update()
783 * and then switch the unionfs vnode's lock to the upper vnode. in unionfs_node_update()
796 * Re-cache the unionfs vnode against the upper vnode in unionfs_node_update()
813 * we may drop the target vnode lock, but we want to avoid the
814 * possibility of a concurrent copy-up on the same vnode triggering
818 unionfs_set_in_progress_flag(struct vnode *vp, unsigned int flag) in unionfs_set_in_progress_flag()
840 * vnode. in unionfs_set_in_progress_flag()
860 unionfs_clear_in_progress_flag(struct vnode *vp, unsigned int flag) in unionfs_clear_in_progress_flag()
885 unionfs_mkshadowdir(struct vnode *dvp, struct vnode *vp, in unionfs_mkshadowdir()
888 struct vnode *lvp; in unionfs_mkshadowdir()
889 struct vnode *uvp; in unionfs_mkshadowdir()
890 struct vnode *udvp; in unionfs_mkshadowdir()
1012 * the unionfs vnode's lock from lvp to uvp; otherwise the in unionfs_mkshadowdir()
1013 * unionfs vnode itself would be transiently unlocked and in unionfs_mkshadowdir()
1052 unionfs_forward_vop_ref(struct vnode *basevp, int *lkflags) in unionfs_forward_vop_ref()
1061 * FS. This should be used for any VOP which may drop the vnode lock;
1063 * The unionfs vnode shares its lock with the base-layer vnode(s); if the
1064 * base FS must transiently drop its vnode lock, the unionfs vnode may
1066 * unmount may doom the unionfs vnode, which leads to two significant
1069 * vnode completely unlocked. When the unionfs vnode becomes doomed
1070 * it stops sharing its lock with the base vnode, so even if the
1071 * forwarded VOP reacquires the base vnode lock the unionfs vnode
1075 * 2) Loss of reference on the base vnode. The caller is expected to
1076 * hold a v_usecount reference on the unionfs vnode, while the
1077 * unionfs vnode holds a reference on the base-layer vnode(s). But
1078 * these references are released when the unionfs vnode becomes
1080 * must hold a reference to prevent vnode recycling.
1093 unionfs_forward_vop_start_pair(struct vnode *basevp1, int *lkflags1, in unionfs_forward_vop_start_pair()
1094 struct vnode *basevp2, int *lkflags2) in unionfs_forward_vop_start_pair()
1106 unionfs_forward_vop_rele(struct vnode *unionvp, struct vnode *basevp, in unionfs_forward_vop_rele()
1135 * unionfs vnode has become doomed.
1138 * vnode has become doomed.
1140 * Returns true if any unionfs vnode was found to be doomed, false
1145 struct vnode *unionvp1, struct vnode *basevp1, int lkflags1, in unionfs_forward_vop_finish_pair()
1146 struct vnode *unionvp2, struct vnode *basevp2, int lkflags2) in unionfs_forward_vop_finish_pair()
1151 * If either vnode is found to have been doomed, set in unionfs_forward_vop_finish_pair()
1153 * Otherwise, simply drop the base-vnode reference that in unionfs_forward_vop_finish_pair()
1165 * means the unionfs vnode's lock is now de-coupled from the in unionfs_forward_vop_finish_pair()
1166 * corresponding base vnode. We therefore need to drop the in unionfs_forward_vop_finish_pair()
1167 * base vnode lock (since nothing else will after this point), in unionfs_forward_vop_finish_pair()
1182 * either the unionfs vnode becoming doomed or its in unionfs_forward_vop_finish_pair()
1185 * vnode anyway. in unionfs_forward_vop_finish_pair()
1209 unionfs_mkwhiteout(struct vnode *dvp, struct vnode *vp, in unionfs_mkwhiteout()
1212 struct vnode *udvp; in unionfs_mkwhiteout()
1213 struct vnode *wvp; in unionfs_mkwhiteout()
1262 * Create a new vnode for create a new shadow file.
1265 * locked, referenced and opened vnode.
1270 unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp, in unionfs_vn_create_on_upper()
1271 struct vnode *vp, struct vattr *uvap, struct thread *td) in unionfs_vn_create_on_upper()
1275 struct vnode *uvp; in unionfs_vn_create_on_upper()
1276 struct vnode *lvp; in unionfs_vn_create_on_upper()
1352 unionfs_copyfile_core(struct vnode *lvp, struct vnode *uvp, in unionfs_copyfile_core()
1417 * vp is a unionfs vnode that should be locked on entry and will be
1423 unionfs_copyfile(struct vnode *vp, int docopy, struct ucred *cred, in unionfs_copyfile()
1429 struct vnode *udvp; in unionfs_copyfile()
1430 struct vnode *lvp; in unionfs_copyfile()
1431 struct vnode *uvp; in unionfs_copyfile()
1523 * We assume the VOP_RMDIR() against the upper layer vnode will take
1537 unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td) in unionfs_check_rmdir()
1539 struct vnode *uvp; in unionfs_check_rmdir()
1540 struct vnode *lvp; in unionfs_check_rmdir()
1541 struct vnode *tvp; in unionfs_check_rmdir()
1560 * VOP_LOOKUP(), that may relock the upper vnode and lock any found in unionfs_check_rmdir()
1561 * child vnode in a way that doesn't protect against deadlock given in unionfs_check_rmdir()
1564 * lower vnode. in unionfs_check_rmdir()
1565 * We might instead just handoff between the upper vnode lock in unionfs_check_rmdir()
1566 * (and its parent directory lock) and the lower vnode lock as needed, in unionfs_check_rmdir()
1573 * do sufficient tracking of empty state within the unionfs vnode in unionfs_check_rmdir()