Lines 2511-2516
unionfs_vptofh(struct vop_vptofh_args *ap)
Link Here
|
2511 |
return (EOPNOTSUPP); |
2511 |
return (EOPNOTSUPP); |
2512 |
} |
2512 |
} |
2513 |
|
2513 |
|
|
|
2514 |
static int |
2515 |
unionfs_add_writecount(struct vop_add_writecount_args *ap) |
2516 |
{ |
2517 |
struct vnode *tvp, *vp; |
2518 |
struct unionfs_node *unp; |
2519 |
int error; |
2520 |
|
2521 |
vp = ap->a_vp; |
2522 |
unp = VTOUNIONFS(vp); |
2523 |
tvp = unp->un_uppervp != NULL ? unp->un_uppervp : unp->un_lowervp; |
2524 |
VI_LOCK(vp); |
2525 |
/* text refs are bypassed to lowervp */ |
2526 |
VNASSERT(vp->v_writecount >= 0, vp, ("wrong null writecount")); |
2527 |
VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp, |
2528 |
("wrong writecount inc %d", ap->a_inc)); |
2529 |
if (tvp != NULL) |
2530 |
error = VOP_ADD_WRITECOUNT(tvp, ap->a_inc); |
2531 |
else if (vp->v_writecount < 0) |
2532 |
error = ETXTBSY; |
2533 |
else |
2534 |
error = 0; |
2535 |
if (error == 0) |
2536 |
vp->v_writecount += ap->a_inc; |
2537 |
VI_UNLOCK(vp); |
2538 |
return (error); |
2539 |
} |
2540 |
|
2514 |
struct vop_vector unionfs_vnodeops = { |
2541 |
struct vop_vector unionfs_vnodeops = { |
2515 |
.vop_default = &default_vnodeops, |
2542 |
.vop_default = &default_vnodeops, |
2516 |
|
2543 |
|
Lines 2559-2562
struct vop_vector unionfs_vnodeops = {
Link Here
|
2559 |
.vop_whiteout = unionfs_whiteout, |
2586 |
.vop_whiteout = unionfs_whiteout, |
2560 |
.vop_write = unionfs_write, |
2587 |
.vop_write = unionfs_write, |
2561 |
.vop_vptofh = unionfs_vptofh, |
2588 |
.vop_vptofh = unionfs_vptofh, |
|
|
2589 |
.vop_add_writecount = unionfs_add_writecount, |
2562 |
}; |
2590 |
}; |