BSD 4_4_Lite2 release
[unix-history] / usr / src / sys / miscfs / union / union.h
index a39ad69..2671985 100644 (file)
@@ -6,9 +6,35 @@
  * This code is derived from software donated to Berkeley by
  * Jan-Simon Pendry.
  *
  * This code is derived from software donated to Berkeley by
  * Jan-Simon Pendry.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)union.h     8.6 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)union.h     8.9 (Berkeley) 12/10/94
  */
 
 struct union_args {
  */
 
 struct union_args {
@@ -53,6 +79,7 @@ struct union_node {
        int                     un_hash;        /* saved un_path hash value */
        int                     un_openl;       /* # of opens on lowervp */
        unsigned int            un_flags;
        int                     un_hash;        /* saved un_path hash value */
        int                     un_openl;       /* # of opens on lowervp */
        unsigned int            un_flags;
+       struct vnode            **un_dircache;  /* cached union stack */
        off_t                   un_uppersz;     /* size of upper object */
        off_t                   un_lowersz;     /* size of lower object */
 #ifdef DIAGNOSTIC
        off_t                   un_uppersz;     /* size of upper object */
        off_t                   un_lowersz;     /* size of lower object */
 #ifdef DIAGNOSTIC
@@ -69,13 +96,17 @@ struct union_node {
 extern int union_allocvp __P((struct vnode **, struct mount *,
                                struct vnode *, struct vnode *,
                                struct componentname *, struct vnode *,
 extern int union_allocvp __P((struct vnode **, struct mount *,
                                struct vnode *, struct vnode *,
                                struct componentname *, struct vnode *,
-                               struct vnode *));
+                               struct vnode *, int));
 extern int union_copyfile __P((struct vnode *, struct vnode *,
                                        struct ucred *, struct proc *));
 extern int union_copyup __P((struct union_node *, int, struct ucred *,
                                struct proc *));
 extern int union_copyfile __P((struct vnode *, struct vnode *,
                                        struct ucred *, struct proc *));
 extern int union_copyup __P((struct union_node *, int, struct ucred *,
                                struct proc *));
+extern int union_dowhiteout __P((struct union_node *, struct ucred *,
+                                       struct proc *));
 extern int union_mkshadow __P((struct union_mount *, struct vnode *,
                                struct componentname *, struct vnode **));
 extern int union_mkshadow __P((struct union_mount *, struct vnode *,
                                struct componentname *, struct vnode **));
+extern int union_mkwhiteout __P((struct union_mount *, struct vnode *,
+                               struct componentname *, char *));
 extern int union_vn_create __P((struct vnode **, struct union_node *,
                                struct proc *));
 extern int union_cn_close __P((struct vnode *, int, struct ucred *,
 extern int union_vn_create __P((struct vnode **, struct union_node *,
                                struct proc *));
 extern int union_cn_close __P((struct vnode *, int, struct ucred *,