SCCS-vsn: sys/miscfs/union/union.h 1.8
SCCS-vsn: sys/miscfs/union/union_subr.c 1.8
SCCS-vsn: sys/miscfs/union/union_vnops.c 1.8
SCCS-vsn: sys/miscfs/union/union_vfsops.c 1.8
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)union.h 1.7 (Berkeley) %G%
+ * @(#)union.h 1.8 (Berkeley) %G%
struct componentname *, struct vnode **));
extern int union_vn_create __P((struct vnode **, struct union_node *,
struct proc *));
struct componentname *, struct vnode **));
extern int union_vn_create __P((struct vnode **, struct union_node *,
struct proc *));
+extern int union_cn_close __P((struct vnode *, int, struct ucred *,
+ struct proc *));
extern void union_removed_upper __P((struct union_node *un));
extern void union_removed_upper __P((struct union_node *un));
+extern struct vnode *union_lowervp __P((struct vnode *));
#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)union_subr.c 1.7 (Berkeley) %G%
+ * @(#)union_subr.c 1.8 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
un->un_next = 0;
un->un_uppervp = uppervp;
un->un_lowervp = lowervp;
un->un_next = 0;
un->un_uppervp = uppervp;
un->un_lowervp = lowervp;
un->un_flags = 0;
if (cnp && (lowervp != NULLVP) && (lowervp->v_type == VREG)) {
un->un_hash = cnp->cn_hash;
un->un_flags = 0;
if (cnp && (lowervp != NULLVP) && (lowervp->v_type == VREG)) {
un->un_hash = cnp->cn_hash;
-union_vn_close(vp, fmode)
+union_vn_close(vp, fmode, cred, p)
struct vnode *vp;
int fmode;
struct vnode *vp;
int fmode;
+ struct ucred *cred;
+ struct proc *p;
{
if (fmode & FWRITE)
--vp->v_writecount;
{
if (fmode & FWRITE)
--vp->v_writecount;
vrele(un->un_uppervp);
un->un_uppervp = NULLVP;
}
vrele(un->un_uppervp);
un->un_uppervp = NULLVP;
}
+
+struct vnode *
+union_lowervp(vp)
+ struct vnode *vp;
+{
+ struct union_node *un = VTOUNION(vp);
+
+ if (un->un_lowervp && (vp->v_type == un->un_lowervp->v_type)) {
+ if (vget(un->un_lowervp, 0))
+ return (NULLVP);
+ }
+
+ return (un->un_lowervp);
+}
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)union_vfsops.c 1.7 (Berkeley) %G%
+ * @(#)union_vfsops.c 1.8 (Berkeley) %G%
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)union_vnops.c 1.7 (Berkeley) %G%
+ * @(#)union_vnops.c 1.8 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
VOP_UNLOCK(tvp);
}
VOP_UNLOCK(un->un_uppervp);
VOP_UNLOCK(tvp);
}
VOP_UNLOCK(un->un_uppervp);
- union_vn_close(un->un_uppervp, FWRITE);
+ union_vn_close(un->un_uppervp, FWRITE, cred, p);
VOP_LOCK(un->un_uppervp);
if (!error)
uprintf("union: copied up %s\n",
VOP_LOCK(un->un_uppervp);
if (!error)
uprintf("union: copied up %s\n",
struct union_node *un = VTOUNION(ap->a_vp);
if (un->un_uppervp) {
struct union_node *un = VTOUNION(ap->a_vp);
if (un->un_uppervp) {
- struct vnode *vp = OTHERVP(ap->a_vp);
+ struct vnode *vp = un->un_uppervp;
VOP_LOCK(vp);
error = VOP_READLINK(vp, ap->a_uio, ap->a_cred);
VOP_LOCK(vp);
error = VOP_READLINK(vp, ap->a_uio, ap->a_cred);
else
un->un_pid = -1;
#endif
else
un->un_pid = -1;
#endif
#ifdef DIAGNOSTIC
un->un_pid = 0;
#endif
#ifdef DIAGNOSTIC
un->un_pid = 0;
#endif