View | Details | Raw Unified | Return to bug 239100
Collapse All | Expand All

(-)b/sys/fs/unionfs/union_subr.c (+7 lines)
Lines 349-354 unionfs_noderem(struct vnode *vp, struct thread *td) Link Here
349
	vp->v_vnlock = &(vp->v_lock);
349
	vp->v_vnlock = &(vp->v_lock);
350
	vp->v_data = NULL;
350
	vp->v_data = NULL;
351
	vp->v_object = NULL;
351
	vp->v_object = NULL;
352
	if (vp->v_writecount > 0) {
353
		if (uvp != NULL)
354
			VOP_ADD_WRITECOUNT(uvp, -vp->v_writecount);
355
		else if (lvp != NULL)
356
			VOP_ADD_WRITECOUNT(lvp, -vp->v_writecount);
357
	} else if (vp->v_writecount < 0)
358
		vp->v_writecount = 0;
352
	VI_UNLOCK(vp);
359
	VI_UNLOCK(vp);
353
360
354
	if (lvp != NULLVP)
361
	if (lvp != NULLVP)
(-)b/sys/fs/unionfs/union_vnops.c (+28 lines)
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
};

Return to bug 239100