sys/vfs/union/union_vnops.c
static int
union_remove(struct vop_old_remove_args *ap)
{
	struct union_node *dun = VTOUNION(ap->a_dvp);
	struct union_node *un = VTOUNION(ap->a_vp);
	struct componentname *cnp = ap->a_cnp;
	struct thread *td = cnp->cn_td;
	struct vnode *uppervp;
	struct vnode *upperdvp;
	int error;

	if ((upperdvp = union_lock_upper(dun, td)) == NULLVP)
		panic("union remove: null upper vnode");

	if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
		if (union_dowhiteout(un, cnp->cn_cred, td))
			cnp->cn_flags |= CNP_DOWHITEOUT;
		error = VOP_REMOVE(upperdvp, uppervp, cnp);
#if 0
		/* XXX */
		if (!error)
			union_removed_upper(un);
#endif
		union_unlock_upper(uppervp, td);
	} else {
		error = union_mkwhiteout(
			    MOUNTTOUNIONMOUNT(ap->a_dvp->v_mount),
			    upperdvp, ap->a_cnp, un->un_path);
	}
	union_unlock_upper(upperdvp, td);
	return (error);
}
/*
 *	union_remove:
 *
 *	Remove the specified cnp.  The dvp and vp are passed to us locked
 *	and must remain locked on return.
 *
 * union_remove(struct vnode *a_dvp, struct vnode *a_vp,
 *		struct componentname *a_cnp)
 */
Remove the specified cnp.  The dvp and vp are passed to us locked
and must remain locked on return.


Remove the specified cnp . The dvp and vp are passed to us locked and must remain locked on return .
static int
union_remove(struct vop_old_remove_args *ap)
{
	struct union_node *dun = VTOUNION(ap->a_dvp);
	struct union_node *un = VTOUNION(ap->a_vp);
	struct componentname *cnp = ap->a_cnp;
	struct thread *td = cnp->cn_td;
	struct vnode *uppervp;
	struct vnode *upperdvp;
	int error;
	if ((upperdvp = union_lock_upper(dun, td)) == NULLVP)
		panic("union remove: null upper vnode");
	if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
		if (union_dowhiteout(un, cnp->cn_cred, td))
			cnp->cn_flags |= CNP_DOWHITEOUT;
		error = VOP_REMOVE(upperdvp, uppervp, cnp);
#if 0
		if (!error)
			union_removed_upper(un);
#endif
		union_unlock_upper(uppervp, td);
	} else {
		error = union_mkwhiteout(
			    MOUNTTOUNIONMOUNT(ap->a_dvp->v_mount),
			    upperdvp, ap->a_cnp, un->un_path);
	}
	union_unlock_upper(upperdvp, td);
	return (error);
}
static int union_remove ( struct vop_old_remove_args * ap ) { struct union_node * dun = VTOUNION ( ap -> a_dvp ) ; struct union_node * un = VTOUNION ( ap -> a_vp ) ; struct componentname * cnp = ap -> a_cnp ; struct thread * td = cnp -> cn_td ; struct vnode * uppervp ; struct vnode * upperdvp ; int error ; if ( ( upperdvp = union_lock_upper ( dun , td ) ) == NULLVP ) panic ( " " ) ; if ( ( uppervp = union_lock_upper ( un , td ) ) != NULLVP ) { if ( union_dowhiteout ( un , cnp -> cn_cred , td ) ) cnp -> cn_flags |= CNP_DOWHITEOUT ; error = VOP_REMOVE ( upperdvp , uppervp , cnp ) ; #if 0 if ( ! error ) union_removed_upper ( un ) ; #endif union_unlock_upper ( uppervp , td ) ; } else { error = union_mkwhiteout ( MOUNTTOUNIONMOUNT ( ap -> a_dvp -> v_mount ) , upperdvp , ap -> a_cnp , un -> un_path ) ; } union_unlock_upper ( upperdvp , td ) ; return ( error ) ; }
union_remove:
      Remove the specified cnp.
union_remove : Remove the specified cnp .
/* XXX */