checkpoint
[unix-history] / usr / src / sys / miscfs / union / union.h
index 74522c1..c8172a7 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)union.h     1.3 (Berkeley) %G%
+ *     @(#)union.h     1.8 (Berkeley) %G%
  */
 
 struct union_args {
  */
 
 struct union_args {
@@ -19,13 +19,9 @@ struct union_mount {
        struct vnode    *um_uppervp;
        struct vnode    *um_lowervp;
        struct ucred    *um_cred;       /* Credentials of user calling mount */
        struct vnode    *um_uppervp;
        struct vnode    *um_lowervp;
        struct ucred    *um_cred;       /* Credentials of user calling mount */
+       int             um_cmode;       /* cmask from mount process */
 };
 
 };
 
-/* begin XXX */
-#define VT_UNION VT_LOFS
-/*#define MOUNT_UNION 15*/
-/* end XXX */
-
 #ifdef KERNEL
 
 /*
 #ifdef KERNEL
 
 /*
@@ -41,19 +37,36 @@ struct union_mount {
  */
 struct union_node {
        struct union_node       *un_next;       /* Hash chain */
  */
 struct union_node {
        struct union_node       *un_next;       /* Hash chain */
+       struct vnode            *un_vnode;      /* Back pointer */
        struct vnode            *un_uppervp;    /* overlaying object */
        struct vnode            *un_lowervp;    /* underlying object */
        struct vnode            *un_dirvp;      /* Parent dir of uppervp */
        struct vnode            *un_uppervp;    /* overlaying object */
        struct vnode            *un_lowervp;    /* underlying object */
        struct vnode            *un_dirvp;      /* Parent dir of uppervp */
-       struct vnode            *un_vnode;      /* Back pointer */
        char                    *un_path;       /* saved component name */
        char                    *un_path;       /* saved component name */
+       int                     un_hash;        /* saved un_path hash value */
+       int                     un_openl;       /* # of opens on lowervp */
        int                     un_flags;
        int                     un_flags;
+#ifdef DIAGNOSTIC
        pid_t                   un_pid;
        pid_t                   un_pid;
+#endif
 };
 
 #define UN_WANT 0x01
 #define UN_LOCKED 0x02
 
 };
 
 #define UN_WANT 0x01
 #define UN_LOCKED 0x02
 
-extern int union_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
+extern int union_allocvp __P((struct vnode **, struct mount *,
+                               struct vnode *, struct vnode *,
+                               struct componentname *, struct vnode *,
+                               struct vnode *));
+extern int union_copyfile __P((struct proc *, struct ucred *,
+                               struct vnode *, struct vnode *));
+extern int union_mkshadow __P((struct union_mount *, struct vnode *,
+                               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 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)