Deleted Added
full compact
union.h (21673) union.h (22521)
1/*
2 * Copyright (c) 1994 The Regents of the University of California.
3 * Copyright (c) 1994 Jan-Simon Pendry.
4 * All rights reserved.
5 *
6 * This code is derived from software donated to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
1/*
2 * Copyright (c) 1994 The Regents of the University of California.
3 * Copyright (c) 1994 Jan-Simon Pendry.
4 * All rights reserved.
5 *
6 * This code is derived from software donated to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * @(#)union.h 8.2 (Berkeley) 2/17/94
38 * $FreeBSD: head/sys/fs/unionfs/union.h 21673 1997-01-14 07:20:47Z jkh $
37 * @(#)union.h 8.9 (Berkeley) 12/10/94
38 * $FreeBSD: head/sys/fs/unionfs/union.h 22521 1997-02-10 02:22:35Z dyson $
39 */
40
41struct union_args {
42 char *target; /* Target of loopback */
43 int mntflags; /* Options on the mount */
44};
45
46#define UNMNT_ABOVE 0x0001 /* Target appears below mount point */

--- 23 unchanged lines hidden (view full) ---

70 * A cache of vnode references
71 */
72struct union_node {
73 LIST_ENTRY(union_node) un_cache; /* Hash chain */
74 struct vnode *un_vnode; /* Back pointer */
75 struct vnode *un_uppervp; /* overlaying object */
76 struct vnode *un_lowervp; /* underlying object */
77 struct vnode *un_dirvp; /* Parent dir of uppervp */
39 */
40
41struct union_args {
42 char *target; /* Target of loopback */
43 int mntflags; /* Options on the mount */
44};
45
46#define UNMNT_ABOVE 0x0001 /* Target appears below mount point */

--- 23 unchanged lines hidden (view full) ---

70 * A cache of vnode references
71 */
72struct union_node {
73 LIST_ENTRY(union_node) un_cache; /* Hash chain */
74 struct vnode *un_vnode; /* Back pointer */
75 struct vnode *un_uppervp; /* overlaying object */
76 struct vnode *un_lowervp; /* underlying object */
77 struct vnode *un_dirvp; /* Parent dir of uppervp */
78 struct vnode *un_pvp; /* Parent vnode */
78 char *un_path; /* saved component name */
79 int un_hash; /* saved un_path hash value */
80 int un_openl; /* # of opens on lowervp */
79 char *un_path; /* saved component name */
80 int un_hash; /* saved un_path hash value */
81 int un_openl; /* # of opens on lowervp */
81 int un_flags;
82 unsigned int un_flags;
83 struct vnode **un_dircache; /* cached union stack */
84 off_t un_uppersz; /* size of upper object */
85 off_t un_lowersz; /* size of lower object */
82#ifdef DIAGNOSTIC
83 pid_t un_pid;
84#endif
85};
86
87#define UN_WANT 0x01
88#define UN_LOCKED 0x02
89#define UN_ULOCK 0x04 /* Upper node is locked */
90#define UN_KLOCK 0x08 /* Keep upper node locked on vput */
86#ifdef DIAGNOSTIC
87 pid_t un_pid;
88#endif
89};
90
91#define UN_WANT 0x01
92#define UN_LOCKED 0x02
93#define UN_ULOCK 0x04 /* Upper node is locked */
94#define UN_KLOCK 0x08 /* Keep upper node locked on vput */
95#define UN_CACHED 0x10 /* In union cache */
91
92extern int union_allocvp __P((struct vnode **, struct mount *,
93 struct vnode *, struct vnode *,
94 struct componentname *, struct vnode *,
96
97extern int union_allocvp __P((struct vnode **, struct mount *,
98 struct vnode *, struct vnode *,
99 struct componentname *, struct vnode *,
95 struct vnode *));
100 struct vnode *, int));
96extern int union_freevp __P((struct vnode *));
101extern int union_freevp __P((struct vnode *));
97extern int union_copyfile __P((struct proc *, struct ucred *,
98 struct vnode *, struct vnode *));
102extern int union_copyfile __P((struct vnode *, struct vnode *,
103 struct ucred *, struct proc *));
104extern int union_copyup __P((struct union_node *, int, struct ucred *,
105 struct proc *));
106extern int union_dowhiteout __P((struct union_node *, struct ucred *,
107 struct proc *));
99extern int union_mkshadow __P((struct union_mount *, struct vnode *,
100 struct componentname *, struct vnode **));
108extern int union_mkshadow __P((struct union_mount *, struct vnode *,
109 struct componentname *, struct vnode **));
110extern int union_mkwhiteout __P((struct union_mount *, struct vnode *,
111 struct componentname *, char *));
101extern int union_vn_create __P((struct vnode **, struct union_node *,
102 struct proc *));
103extern int union_vn_close __P((struct vnode *, int, struct ucred *,
104 struct proc *));
105extern int union_cn_close __P((struct vnode *, int, struct ucred *,
106 struct proc *));
107extern void union_removed_upper __P((struct union_node *un));
108extern struct vnode *union_lowervp __P((struct vnode *));
109extern void union_newlower __P((struct union_node *, struct vnode *));
110extern void union_newupper __P((struct union_node *, struct vnode *));
112extern int union_vn_create __P((struct vnode **, struct union_node *,
113 struct proc *));
114extern int union_vn_close __P((struct vnode *, int, struct ucred *,
115 struct proc *));
116extern int union_cn_close __P((struct vnode *, int, struct ucred *,
117 struct proc *));
118extern void union_removed_upper __P((struct union_node *un));
119extern struct vnode *union_lowervp __P((struct vnode *));
120extern void union_newlower __P((struct union_node *, struct vnode *));
121extern void union_newupper __P((struct union_node *, struct vnode *));
122extern void union_newsize __P((struct vnode *, off_t, off_t));
111
112#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
113#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
114#define UNIONTOV(un) ((un)->un_vnode)
115#define LOWERVP(vp) (VTOUNION(vp)->un_lowervp)
116#define UPPERVP(vp) (VTOUNION(vp)->un_uppervp)
117#define OTHERVP(vp) (UPPERVP(vp) ? UPPERVP(vp) : LOWERVP(vp))
118
119extern vop_t **union_vnodeop_p;
120extern struct vfsops union_vfsops;
121#endif /* KERNEL */
123
124#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
125#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
126#define UNIONTOV(un) ((un)->un_vnode)
127#define LOWERVP(vp) (VTOUNION(vp)->un_lowervp)
128#define UPPERVP(vp) (VTOUNION(vp)->un_uppervp)
129#define OTHERVP(vp) (UPPERVP(vp) ? UPPERVP(vp) : LOWERVP(vp))
130
131extern vop_t **union_vnodeop_p;
132extern struct vfsops union_vfsops;
133#endif /* KERNEL */