PSEUDOCODE
int
vop_remove(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
{
int error = 0;
if (vp is immutable) {
error = EPERM;
goto out;
}
/*
* Remove name cnp->cn_nameptr from directory and update link count
* of vp.
*/
...;
/*
* Careful about trying to remove ".". XXX this should be handled
* higher up.
*/
if (dvp == vp)
vrele(vp);
else
vput(vp);
vput(dvp);
return error;
}
ERRORS