summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs/union_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/unionfs/union_vnops.c')
-rw-r--r--sys/fs/unionfs/union_vnops.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 65714cd..7e176dd 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -670,10 +670,20 @@ union_whiteout(ap)
struct vnode *uppervp;
int error = EOPNOTSUPP;
- if ((uppervp = union_lock_upper(un, cnp->cn_thread)) != NULLVP) {
- error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags);
- union_unlock_upper(uppervp, cnp->cn_thread);
- }
+ switch (ap->a_flags) {
+ case LOOKUP:
+ error = EOPNOTSUPP;
+ break;
+ case CREATE:
+ case DELETE:
+ if ((uppervp=union_lock_upper(un,cnp->cn_thread)) != NULLVP) {
+ error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags);
+ union_unlock_upper(uppervp, cnp->cn_thread);
+ }
+ break;
+ default:
+ panic("union_whiteout: unknown op");
+ }
return(error);
}
OpenPOWER on IntegriCloud