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