xref: /xnu-10063.101.15/bsd/sys/namei.h (revision 94d3b452840153a99b38a3a9659680b2a006908e)
1*94d3b452SApple OSS Distributions /*
2*94d3b452SApple OSS Distributions  * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
3*94d3b452SApple OSS Distributions  *
4*94d3b452SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*94d3b452SApple OSS Distributions  *
6*94d3b452SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*94d3b452SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*94d3b452SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*94d3b452SApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*94d3b452SApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*94d3b452SApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*94d3b452SApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*94d3b452SApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*94d3b452SApple OSS Distributions  *
15*94d3b452SApple OSS Distributions  * Please obtain a copy of the License at
16*94d3b452SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*94d3b452SApple OSS Distributions  *
18*94d3b452SApple OSS Distributions  * The Original Code and all software distributed under the License are
19*94d3b452SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*94d3b452SApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*94d3b452SApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*94d3b452SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*94d3b452SApple OSS Distributions  * Please see the License for the specific language governing rights and
24*94d3b452SApple OSS Distributions  * limitations under the License.
25*94d3b452SApple OSS Distributions  *
26*94d3b452SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*94d3b452SApple OSS Distributions  */
28*94d3b452SApple OSS Distributions /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29*94d3b452SApple OSS Distributions /*
30*94d3b452SApple OSS Distributions  * Copyright (c) 1985, 1989, 1991, 1993
31*94d3b452SApple OSS Distributions  *	The Regents of the University of California.  All rights reserved.
32*94d3b452SApple OSS Distributions  *
33*94d3b452SApple OSS Distributions  * Redistribution and use in source and binary forms, with or without
34*94d3b452SApple OSS Distributions  * modification, are permitted provided that the following conditions
35*94d3b452SApple OSS Distributions  * are met:
36*94d3b452SApple OSS Distributions  * 1. Redistributions of source code must retain the above copyright
37*94d3b452SApple OSS Distributions  *    notice, this list of conditions and the following disclaimer.
38*94d3b452SApple OSS Distributions  * 2. Redistributions in binary form must reproduce the above copyright
39*94d3b452SApple OSS Distributions  *    notice, this list of conditions and the following disclaimer in the
40*94d3b452SApple OSS Distributions  *    documentation and/or other materials provided with the distribution.
41*94d3b452SApple OSS Distributions  * 3. All advertising materials mentioning features or use of this software
42*94d3b452SApple OSS Distributions  *    must display the following acknowledgement:
43*94d3b452SApple OSS Distributions  *	This product includes software developed by the University of
44*94d3b452SApple OSS Distributions  *	California, Berkeley and its contributors.
45*94d3b452SApple OSS Distributions  * 4. Neither the name of the University nor the names of its contributors
46*94d3b452SApple OSS Distributions  *    may be used to endorse or promote products derived from this software
47*94d3b452SApple OSS Distributions  *    without specific prior written permission.
48*94d3b452SApple OSS Distributions  *
49*94d3b452SApple OSS Distributions  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50*94d3b452SApple OSS Distributions  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51*94d3b452SApple OSS Distributions  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52*94d3b452SApple OSS Distributions  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53*94d3b452SApple OSS Distributions  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54*94d3b452SApple OSS Distributions  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55*94d3b452SApple OSS Distributions  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56*94d3b452SApple OSS Distributions  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57*94d3b452SApple OSS Distributions  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58*94d3b452SApple OSS Distributions  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59*94d3b452SApple OSS Distributions  * SUCH DAMAGE.
60*94d3b452SApple OSS Distributions  *
61*94d3b452SApple OSS Distributions  *	@(#)namei.h	8.4 (Berkeley) 8/20/94
62*94d3b452SApple OSS Distributions  */
63*94d3b452SApple OSS Distributions 
64*94d3b452SApple OSS Distributions #ifndef _SYS_NAMEI_H_
65*94d3b452SApple OSS Distributions #define _SYS_NAMEI_H_
66*94d3b452SApple OSS Distributions 
67*94d3b452SApple OSS Distributions #include <sys/appleapiopts.h>
68*94d3b452SApple OSS Distributions 
69*94d3b452SApple OSS Distributions #ifdef KERNEL
70*94d3b452SApple OSS Distributions #define LOCKLEAF        0x0004  /* lock inode on return */
71*94d3b452SApple OSS Distributions #define LOCKPARENT      0x0008  /* want parent vnode returned */
72*94d3b452SApple OSS Distributions #define WANTPARENT      0x0010  /* want parent vnode returned */
73*94d3b452SApple OSS Distributions 
74*94d3b452SApple OSS Distributions #ifdef KERNEL_PRIVATE
75*94d3b452SApple OSS Distributions #define CN_SECLUDE_RENAME 0x10000000 /*rename iff ¬(hard-linked ∨ opened ∨ mmaped)*/
76*94d3b452SApple OSS Distributions #define CN_RAW_ENCRYPTED 0x80000000 /* Look-up is for RO raw encrypted access. */
77*94d3b452SApple OSS Distributions #endif
78*94d3b452SApple OSS Distributions 
79*94d3b452SApple OSS Distributions #endif // KERNEL
80*94d3b452SApple OSS Distributions 
81*94d3b452SApple OSS Distributions #ifdef BSD_KERNEL_PRIVATE
82*94d3b452SApple OSS Distributions 
83*94d3b452SApple OSS Distributions /* VFS Supports "/..namedfork/rsrc" access. */
84*94d3b452SApple OSS Distributions #define NAMEDRSRCFORK           NAMEDSTREAMS
85*94d3b452SApple OSS Distributions 
86*94d3b452SApple OSS Distributions 
87*94d3b452SApple OSS Distributions #include <sys/queue.h>
88*94d3b452SApple OSS Distributions #include <kern/smr.h>
89*94d3b452SApple OSS Distributions #include <sys/uio.h>
90*94d3b452SApple OSS Distributions #include <sys/vnode.h>
91*94d3b452SApple OSS Distributions #include <sys/mount.h>
92*94d3b452SApple OSS Distributions #include <sys/filedesc.h>
93*94d3b452SApple OSS Distributions 
94*94d3b452SApple OSS Distributions #define PATHBUFLEN      256
95*94d3b452SApple OSS Distributions 
96*94d3b452SApple OSS Distributions /*
97*94d3b452SApple OSS Distributions  * Encapsulation of namei parameters.
98*94d3b452SApple OSS Distributions  */
99*94d3b452SApple OSS Distributions struct nameidata {
100*94d3b452SApple OSS Distributions 	/*
101*94d3b452SApple OSS Distributions 	 * Arguments to namei/lookup.
102*94d3b452SApple OSS Distributions 	 */
103*94d3b452SApple OSS Distributions 	user_addr_t ni_dirp;            /* pathname pointer */
104*94d3b452SApple OSS Distributions 	enum    uio_seg ni_segflg;      /* location of pathname */
105*94d3b452SApple OSS Distributions 	enum    path_operation ni_op;   /* intended operation, see enum path_operation in vnode.h */
106*94d3b452SApple OSS Distributions 	/*
107*94d3b452SApple OSS Distributions 	 * Arguments to lookup.
108*94d3b452SApple OSS Distributions 	 */
109*94d3b452SApple OSS Distributions 	struct  vnode *ni_startdir;     /* starting directory */
110*94d3b452SApple OSS Distributions 	struct  vnode *ni_rootdir;      /* logical root directory */
111*94d3b452SApple OSS Distributions 	struct  vnode *ni_usedvp;       /* directory passed in via USEDVP */
112*94d3b452SApple OSS Distributions 	/*
113*94d3b452SApple OSS Distributions 	 * Results: returned from/manipulated by lookup
114*94d3b452SApple OSS Distributions 	 */
115*94d3b452SApple OSS Distributions 	struct  vnode *ni_vp;           /* vnode of result */
116*94d3b452SApple OSS Distributions 	struct  vnode *ni_dvp;          /* vnode of intermediate directory */
117*94d3b452SApple OSS Distributions 	/*
118*94d3b452SApple OSS Distributions 	 * Shared between namei and lookup/commit routines.
119*94d3b452SApple OSS Distributions 	 */
120*94d3b452SApple OSS Distributions 	u_int   ni_pathlen;             /* remaining chars in path */
121*94d3b452SApple OSS Distributions 	char    *ni_next;               /* next location in pathname */
122*94d3b452SApple OSS Distributions 	char    ni_pathbuf[PATHBUFLEN];
123*94d3b452SApple OSS Distributions 	u_long  ni_loopcnt;             /* count of symlinks encountered */
124*94d3b452SApple OSS Distributions 
125*94d3b452SApple OSS Distributions 	struct componentname ni_cnd;
126*94d3b452SApple OSS Distributions 	int32_t ni_flag;
127*94d3b452SApple OSS Distributions 	int ni_ncgeneration;            /* For a batched vnop, grab generation beforehand */
128*94d3b452SApple OSS Distributions };
129*94d3b452SApple OSS Distributions 
130*94d3b452SApple OSS Distributions #define NAMEI_CONTLOOKUP        0x002    /* Continue processing a lookup which was partially processed in a compound VNOP */
131*94d3b452SApple OSS Distributions #define NAMEI_TRAILINGSLASH     0x004    /* There was at least one trailing slash after last component */
132*94d3b452SApple OSS Distributions #define NAMEI_UNFINISHED        0x008    /* We broke off a lookup to do a compound op */
133*94d3b452SApple OSS Distributions 
134*94d3b452SApple OSS Distributions /*
135*94d3b452SApple OSS Distributions  * XXX Hack: we need to encode the intended VNOP in order to
136*94d3b452SApple OSS Distributions  * be able to include information about which operations a filesystem
137*94d3b452SApple OSS Distributions  * supports in the decision to break off a lookup early.
138*94d3b452SApple OSS Distributions  */
139*94d3b452SApple OSS Distributions #define NAMEI_COMPOUNDOPEN      0x010
140*94d3b452SApple OSS Distributions #define NAMEI_COMPOUNDREMOVE    0x020
141*94d3b452SApple OSS Distributions #define NAMEI_COMPOUNDMKDIR     0x040
142*94d3b452SApple OSS Distributions #define NAMEI_COMPOUNDRMDIR     0x080
143*94d3b452SApple OSS Distributions #define NAMEI_COMPOUNDRENAME    0x100
144*94d3b452SApple OSS Distributions #define NAMEI_COMPOUND_OP_MASK (NAMEI_COMPOUNDOPEN | NAMEI_COMPOUNDREMOVE | NAMEI_COMPOUNDMKDIR | NAMEI_COMPOUNDRMDIR | NAMEI_COMPOUNDRENAME)
145*94d3b452SApple OSS Distributions 
146*94d3b452SApple OSS Distributions #define NAMEI_NOFOLLOW_ANY      0x1000  /* no symlinks allowed in the path */
147*94d3b452SApple OSS Distributions #define NAMEI_ROOTDIR           0x2000  /* Limit lookup to ni_rootdir (similar to chroot) */
148*94d3b452SApple OSS Distributions 
149*94d3b452SApple OSS Distributions #ifdef KERNEL
150*94d3b452SApple OSS Distributions /*
151*94d3b452SApple OSS Distributions  * namei operational modifier flags, stored in ni_cnd.flags
152*94d3b452SApple OSS Distributions  * Also includes LOCKLEAF, LOCKPARENT, and WANTPARENT flags, defined above.
153*94d3b452SApple OSS Distributions  */
154*94d3b452SApple OSS Distributions #define NOCACHE         0x00000020 /* name must not be left in cache */
155*94d3b452SApple OSS Distributions #define NOFOLLOW        0x00000000 /* do not follow symbolic links (pseudo) */
156*94d3b452SApple OSS Distributions /* public FOLLOW	0x00000040    see vnode.h */
157*94d3b452SApple OSS Distributions #define SHAREDLEAF      0x00000080 /* OK to have shared leaf lock */
158*94d3b452SApple OSS Distributions #define MODMASK         0x100000fc /* mask of operational modifiers */
159*94d3b452SApple OSS Distributions /*
160*94d3b452SApple OSS Distributions  * Namei parameter descriptors.
161*94d3b452SApple OSS Distributions  *
162*94d3b452SApple OSS Distributions  * SAVESTART is set only by the callers of namei. It implies SAVENAME
163*94d3b452SApple OSS Distributions  * plus the addition of saving the parent directory that contains the
164*94d3b452SApple OSS Distributions  * name in ni_startdir. It allows repeated calls to lookup for the
165*94d3b452SApple OSS Distributions  * name being sought. The caller is responsible for releasing the
166*94d3b452SApple OSS Distributions  * buffer and for vrele'ing ni_startdir.
167*94d3b452SApple OSS Distributions  */
168*94d3b452SApple OSS Distributions #define SAVENAME        0          /* save pathanme buffer ***obsolete */
169*94d3b452SApple OSS Distributions #define NOCROSSMOUNT    0x00000100 /* do not cross mount points */
170*94d3b452SApple OSS Distributions #define RDONLY          0x00000200 /* lookup with read-only semantics */
171*94d3b452SApple OSS Distributions #define HASBUF          0x00000400 /* has allocated pathname buffer */
172*94d3b452SApple OSS Distributions #define DONOTAUTH       0x00000800 /* do not authorize during lookup */
173*94d3b452SApple OSS Distributions #define SAVESTART       0x00001000 /* save starting directory */
174*94d3b452SApple OSS Distributions /* public ISDOTDOT	0x00002000    see vnode.h */
175*94d3b452SApple OSS Distributions /* public MAKEENTRY	0x00004000    see vnode.h */
176*94d3b452SApple OSS Distributions /* public ISLASTCN	0x00008000    see vnode.h */
177*94d3b452SApple OSS Distributions #define ISSYMLINK       0x00010000 /* symlink needs interpretation */
178*94d3b452SApple OSS Distributions /* public ISWHITEOUT	0x00020000    see vnode.h */
179*94d3b452SApple OSS Distributions /* public DOWHITEOUT	0x00040000    see vnode.h */
180*94d3b452SApple OSS Distributions #define WILLBEDIR       0x00080000 /* new files will be dirs; allow trailing / */
181*94d3b452SApple OSS Distributions #define AUDITVNPATH1    0x00100000 /* audit the path/vnode info */
182*94d3b452SApple OSS Distributions #define AUDITVNPATH2    0x00200000 /* audit the path/vnode info */
183*94d3b452SApple OSS Distributions #define USEDVP          0x00400000 /* start the lookup at ndp.ni_dvp */
184*94d3b452SApple OSS Distributions #define CN_VOLFSPATH    0x00800000 /* user path was a volfs style path */
185*94d3b452SApple OSS Distributions #define CN_FIRMLINK_NOFOLLOW    0x01000000 /* Do not follow firm links */
186*94d3b452SApple OSS Distributions #define UNIONCREATED    0x02000000 /* union fs creation of vnode */
187*94d3b452SApple OSS Distributions #if NAMEDRSRCFORK
188*94d3b452SApple OSS Distributions #define CN_WANTSRSRCFORK 0x04000000
189*94d3b452SApple OSS Distributions #define CN_ALLOWRSRCFORK 0x08000000
190*94d3b452SApple OSS Distributions #endif // NAMEDRSRCFORK
191*94d3b452SApple OSS Distributions // CN_SECLUDE_RENAME is defined above as 0x10000000 (SPI)
192*94d3b452SApple OSS Distributions #define CN_NBMOUNTLOOK  0x20000000 /* do not block for cross mount lookups */
193*94d3b452SApple OSS Distributions #ifdef BSD_KERNEL_PRIVATE
194*94d3b452SApple OSS Distributions #define CN_SKIPNAMECACHE        0x40000000      /* skip cache during lookup(), allow FS to handle all components */
195*94d3b452SApple OSS Distributions #endif
196*94d3b452SApple OSS Distributions // CN_RAW_ENCRYPTED	is defined above as 0x80000000 (SPI)
197*94d3b452SApple OSS Distributions 
198*94d3b452SApple OSS Distributions /*
199*94d3b452SApple OSS Distributions  * Initialization of an nameidata structure.
200*94d3b452SApple OSS Distributions  */
201*94d3b452SApple OSS Distributions 
202*94d3b452SApple OSS Distributions #define NDINIT(ndp, op, pop, flags, segflg, namep, ctx) { \
203*94d3b452SApple OSS Distributions 	(ndp)->ni_cnd.cn_nameiop = op; \
204*94d3b452SApple OSS Distributions 	(ndp)->ni_op = pop; \
205*94d3b452SApple OSS Distributions 	(ndp)->ni_cnd.cn_flags = flags; \
206*94d3b452SApple OSS Distributions 	if ((segflg) == UIO_USERSPACE) { \
207*94d3b452SApple OSS Distributions 	        (ndp)->ni_segflg = (vfs_context_is64bit(ctx) ? UIO_USERSPACE64 : UIO_USERSPACE32); \
208*94d3b452SApple OSS Distributions 	} \
209*94d3b452SApple OSS Distributions 	else { \
210*94d3b452SApple OSS Distributions 	        (ndp)->ni_segflg = segflg; \
211*94d3b452SApple OSS Distributions 	} \
212*94d3b452SApple OSS Distributions 	(ndp)->ni_dirp = namep; \
213*94d3b452SApple OSS Distributions 	(ndp)->ni_cnd.cn_context = ctx; \
214*94d3b452SApple OSS Distributions 	(ndp)->ni_flag = 0; \
215*94d3b452SApple OSS Distributions 	(ndp)->ni_cnd.cn_ndp = (ndp); \
216*94d3b452SApple OSS Distributions }
217*94d3b452SApple OSS Distributions 
218*94d3b452SApple OSS Distributions #endif /* KERNEL */
219*94d3b452SApple OSS Distributions 
220*94d3b452SApple OSS Distributions /*
221*94d3b452SApple OSS Distributions  * This structure describes the elements in the cache of recent
222*94d3b452SApple OSS Distributions  * names looked up by namei.
223*94d3b452SApple OSS Distributions  */
224*94d3b452SApple OSS Distributions struct  namecache {
225*94d3b452SApple OSS Distributions 	TAILQ_ENTRY(namecache)  nc_entry;       /* chain of all entries */
226*94d3b452SApple OSS Distributions 	TAILQ_ENTRY(namecache)  nc_child;       /* chain of ncp's that are children of a vp */
227*94d3b452SApple OSS Distributions 	union {
228*94d3b452SApple OSS Distributions 		LIST_ENTRY(namecache)  nc_link; /* chain of ncp's that 'name' a vp */
229*94d3b452SApple OSS Distributions 		TAILQ_ENTRY(namecache) nc_negentry; /* chain of ncp's that 'name' a vp */
230*94d3b452SApple OSS Distributions 	} nc_un;
231*94d3b452SApple OSS Distributions 	struct smrq_link        nc_hash;        /* hash chain */
232*94d3b452SApple OSS Distributions 	uint32_t                nc_vid;         /* vid for nc_vp */
233*94d3b452SApple OSS Distributions 	uint32_t                nc_counter;     /* flags */
234*94d3b452SApple OSS Distributions 	vnode_t                 nc_dvp;         /* vnode of parent of name */
235*94d3b452SApple OSS Distributions 	vnode_t                 nc_vp;          /* vnode the name refers to */
236*94d3b452SApple OSS Distributions 	unsigned int            nc_hashval;     /* hashval of stringname */
237*94d3b452SApple OSS Distributions 	const char              *nc_name;       /* pointer to segment name in string cache */
238*94d3b452SApple OSS Distributions };
239*94d3b452SApple OSS Distributions 
240*94d3b452SApple OSS Distributions #define NC_VALID 0x01  /* counter value with this bit set (i.e. odd number) represents an valid/in-use namecache struct */
241*94d3b452SApple OSS Distributions 
242*94d3b452SApple OSS Distributions #ifdef KERNEL
243*94d3b452SApple OSS Distributions 
244*94d3b452SApple OSS Distributions int     namei(struct nameidata *ndp);
245*94d3b452SApple OSS Distributions void    nameidone(struct nameidata *);
246*94d3b452SApple OSS Distributions int     lookup(struct nameidata *ndp);
247*94d3b452SApple OSS Distributions int     relookup(struct vnode *dvp, struct vnode **vpp,
248*94d3b452SApple OSS Distributions     struct componentname *cnp);
249*94d3b452SApple OSS Distributions #if CONFIG_UNION_MOUNTS
250*94d3b452SApple OSS Distributions int     lookup_traverse_union(vnode_t dvp, vnode_t *new_dvp, vfs_context_t ctx);
251*94d3b452SApple OSS Distributions #endif /* CONFIG_UNION_MOUNTS */
252*94d3b452SApple OSS Distributions void    lookup_compound_vnop_post_hook(int error, vnode_t dvp, vnode_t vp, struct nameidata *ndp, int did_create);
253*94d3b452SApple OSS Distributions void    kdebug_lookup(struct vnode *dp, struct componentname *cnp);
254*94d3b452SApple OSS Distributions 
255*94d3b452SApple OSS Distributions /*
256*94d3b452SApple OSS Distributions  * namecache function prototypes
257*94d3b452SApple OSS Distributions  */
258*94d3b452SApple OSS Distributions void    cache_purgevfs(mount_t mp);
259*94d3b452SApple OSS Distributions int             cache_lookup_path(struct nameidata *ndp, struct componentname *cnp, vnode_t dp,
260*94d3b452SApple OSS Distributions     vfs_context_t context, int *dp_authorized, vnode_t last_dp);
261*94d3b452SApple OSS Distributions 
262*94d3b452SApple OSS Distributions void            vnode_cache_authorized_action(vnode_t vp, vfs_context_t context, kauth_action_t action);
263*94d3b452SApple OSS Distributions void            vnode_uncache_authorized_action(vnode_t vp, kauth_action_t action);
264*94d3b452SApple OSS Distributions boolean_t       vnode_cache_is_stale(vnode_t vp);
265*94d3b452SApple OSS Distributions boolean_t       vnode_cache_is_authorized(vnode_t vp, vfs_context_t context, kauth_action_t action);
266*94d3b452SApple OSS Distributions int             lookup_validate_creation_path(struct nameidata *ndp);
267*94d3b452SApple OSS Distributions int             namei_compound_available(vnode_t dp, struct nameidata *ndp);
268*94d3b452SApple OSS Distributions 
269*94d3b452SApple OSS Distributions #endif /* KERNEL */
270*94d3b452SApple OSS Distributions 
271*94d3b452SApple OSS Distributions /*
272*94d3b452SApple OSS Distributions  * Stats on usefulness of namei caches.
273*94d3b452SApple OSS Distributions  */
274*94d3b452SApple OSS Distributions struct  nchstats {
275*94d3b452SApple OSS Distributions 	long    ncs_goodhits;           /* hits that we can really use */
276*94d3b452SApple OSS Distributions 	long    ncs_neghits;            /* negative hits that we can use */
277*94d3b452SApple OSS Distributions 	long    ncs_badhits;            /* hits we must drop */
278*94d3b452SApple OSS Distributions 	long    ncs_miss;               /* misses */
279*94d3b452SApple OSS Distributions 	long    ncs_pass2;              /* names found with passes == 2 */
280*94d3b452SApple OSS Distributions 	long    ncs_2passes;            /* number of times we attempt it */
281*94d3b452SApple OSS Distributions 	long    ncs_stolen;
282*94d3b452SApple OSS Distributions 	long    ncs_enters;
283*94d3b452SApple OSS Distributions 	long    ncs_deletes;
284*94d3b452SApple OSS Distributions 	long    ncs_badvid;
285*94d3b452SApple OSS Distributions };
286*94d3b452SApple OSS Distributions #endif /* BSD_KERNEL_PRIVATE */
287*94d3b452SApple OSS Distributions 
288*94d3b452SApple OSS Distributions #endif /* !_SYS_NAMEI_H_ */
289