|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /* $NetBSD: umap.h,v 1.4 1995/03/29 22:09:57 briggs Exp $ */
26:
27: /*
28: * Copyright (c) 1992, 1993
29: * The Regents of the University of California. All rights reserved.
30: *
31: * This code is derived from software donated to Berkeley by
32: * the UCLA Ficus project.
33: *
34: * Redistribution and use in source and binary forms, with or without
35: * modification, are permitted provided that the following conditions
36: * are met:
37: * 1. Redistributions of source code must retain the above copyright
38: * notice, this list of conditions and the following disclaimer.
39: * 2. Redistributions in binary form must reproduce the above copyright
40: * notice, this list of conditions and the following disclaimer in the
41: * documentation and/or other materials provided with the distribution.
42: * 3. All advertising materials mentioning features or use of this software
43: * must display the following acknowledgement:
44: * This product includes software developed by the University of
45: * California, Berkeley and its contributors.
46: * 4. Neither the name of the University nor the names of its contributors
47: * may be used to endorse or promote products derived from this software
48: * without specific prior written permission.
49: *
50: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
51: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60: * SUCH DAMAGE.
61: *
62: * from: @(#)null_vnops.c 1.5 (Berkeley) 7/10/92
63: * @(#)umap.h 8.3 (Berkeley) 1/21/94
64: */
65:
66: #define MAPFILEENTRIES 64
67: #define GMAPFILEENTRIES 16
68: #define NOBODY 32767
69: #define NULLGROUP 65534
70:
71: struct umap_args {
72: char *target; /* Target of loopback */
73: int nentries; /* # of entries in user map array */
74: int gnentries; /* # of entries in group map array */
75: uid_t (*mapdata)[2]; /* pointer to array of user mappings */
76: gid_t (*gmapdata)[2]; /* pointer to array of group mappings */
77: };
78:
79: struct umap_mount {
80: struct mount *umapm_vfs;
81: struct vnode *umapm_rootvp; /* Reference to root umap_node */
82: int info_nentries; /* number of uid mappings */
83: int info_gnentries; /* number of gid mappings */
84: uid_t info_mapdata[MAPFILEENTRIES][2]; /* mapping data for
85: user mapping in ficus */
86: gid_t info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for
87: group mapping in ficus */
88: };
89:
90: #ifdef _KERNEL
91: /*
92: * A cache of vnode references
93: */
94: struct umap_node {
95: LIST_ENTRY(umap_node) umap_hash; /* Hash list */
96: struct vnode *umap_lowervp; /* Aliased vnode - VREFed once */
97: struct vnode *umap_vnode; /* Back pointer to vnode/umap_node */
98: };
99:
100: extern int umap_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
101: extern u_long umap_reverse_findid __P((u_long id, u_long map[][2], int nentries));
102: extern void umap_mapids __P((struct mount *v_mount, struct ucred *credp));
103:
104: #define MOUNTTOUMAPMOUNT(mp) ((struct umap_mount *)((mp)->mnt_data))
105: #define VTOUMAP(vp) ((struct umap_node *)(vp)->v_data)
106: #define UMAPTOV(xp) ((xp)->umap_vnode)
107: #ifdef UMAPFS_DIAGNOSTIC
108: extern struct vnode *umap_checkvp __P((struct vnode *vp, char *fil, int lno));
109: #define UMAPVPTOLOWERVP(vp) umap_checkvp((vp), __FILE__, __LINE__)
110: #else
111: #define UMAPVPTOLOWERVP(vp) (VTOUMAP(vp)->umap_lowervp)
112: #endif
113:
114: extern int (**umap_vnodeop_p)();
115: extern struct vfsops umap_vfsops;
116: #endif /* _KERNEL */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.