| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: namei.src,v 1.55 2020/05/16 18:31:53 christos Exp $ */ | | 1 | /* $NetBSD: namei.src,v 1.56 2020/05/26 22:05:52 ad Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1985, 1989, 1991, 1993 | | 4 | * Copyright (c) 1985, 1989, 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -153,31 +153,32 @@ NAMEIFL NOFOLLOW 0x00000000 /* do not fo | | | @@ -153,31 +153,32 @@ NAMEIFL NOFOLLOW 0x00000000 /* do not fo |
153 | NAMEIFL EMULROOTSET 0x00000080 /* emulation root already | | 153 | NAMEIFL EMULROOTSET 0x00000080 /* emulation root already |
154 | in ni_erootdir */ | | 154 | in ni_erootdir */ |
155 | NAMEIFL LOCKSHARED 0x00000100 /* want shared locks if possible */ | | 155 | NAMEIFL LOCKSHARED 0x00000100 /* want shared locks if possible */ |
156 | NAMEIFL NOCHROOT 0x01000000 /* no chroot on abs path lookups */ | | 156 | NAMEIFL NOCHROOT 0x01000000 /* no chroot on abs path lookups */ |
157 | NAMEIFL MODMASK 0x010001fc /* mask of operational modifiers */ | | 157 | NAMEIFL MODMASK 0x010001fc /* mask of operational modifiers */ |
158 | /* | | 158 | /* |
159 | * Namei parameter descriptors. | | 159 | * Namei parameter descriptors. |
160 | */ | | 160 | */ |
161 | NAMEIFL NOCROSSMOUNT 0x0000800 /* do not cross mount points */ | | 161 | NAMEIFL NOCROSSMOUNT 0x0000800 /* do not cross mount points */ |
162 | NAMEIFL RDONLY 0x0001000 /* lookup with read-only semantics */ | | 162 | NAMEIFL RDONLY 0x0001000 /* lookup with read-only semantics */ |
163 | NAMEIFL ISDOTDOT 0x0002000 /* current component name is .. */ | | 163 | NAMEIFL ISDOTDOT 0x0002000 /* current component name is .. */ |
164 | NAMEIFL MAKEENTRY 0x0004000 /* entry is to be added to name cache */ | | 164 | NAMEIFL MAKEENTRY 0x0004000 /* entry is to be added to name cache */ |
165 | NAMEIFL ISLASTCN 0x0008000 /* this is last component of pathname */ | | 165 | NAMEIFL ISLASTCN 0x0008000 /* this is last component of pathname */ |
| | | 166 | NAMIEFL WILLBEDIR 0x0010000 /* new files will be dirs */ |
166 | NAMEIFL ISWHITEOUT 0x0020000 /* found whiteout */ | | 167 | NAMEIFL ISWHITEOUT 0x0020000 /* found whiteout */ |
167 | NAMEIFL DOWHITEOUT 0x0040000 /* do whiteouts */ | | 168 | NAMEIFL DOWHITEOUT 0x0040000 /* do whiteouts */ |
168 | NAMEIFL REQUIREDIR 0x0080000 /* must be a directory */ | | 169 | NAMEIFL REQUIREDIR 0x0080000 /* must be a directory */ |
169 | NAMEIFL CREATEDIR 0x0200000 /* trailing slashes are ok */ | | 170 | NAMEIFL CREATEDIR 0x0200000 /* trailing slashes are ok */ |
170 | NAMEIFL PARAMASK 0x02ef800 /* mask of parameter descriptors */ | | 171 | NAMEIFL PARAMASK 0x02ff800 /* mask of parameter descriptors */ |
171 | | | 172 | |
172 | /* | | 173 | /* |
173 | * Initialization of a nameidata structure. | | 174 | * Initialization of a nameidata structure. |
174 | */ | | 175 | */ |
175 | #define NDINIT(ndp, op, flags, pathbuf) { \ | | 176 | #define NDINIT(ndp, op, flags, pathbuf) { \ |
176 | (ndp)->ni_cnd.cn_nameiop = op; \ | | 177 | (ndp)->ni_cnd.cn_nameiop = op; \ |
177 | (ndp)->ni_cnd.cn_flags = flags; \ | | 178 | (ndp)->ni_cnd.cn_flags = flags; \ |
178 | (ndp)->ni_atdir = NULL; \ | | 179 | (ndp)->ni_atdir = NULL; \ |
179 | (ndp)->ni_pathbuf = pathbuf; \ | | 180 | (ndp)->ni_pathbuf = pathbuf; \ |
180 | (ndp)->ni_cnd.cn_cred = kauth_cred_get(); \ | | 181 | (ndp)->ni_cnd.cn_cred = kauth_cred_get(); \ |
181 | } | | 182 | } |
182 | | | 183 | |
183 | /* | | 184 | /* |
| @@ -280,27 +281,27 @@ int lookup_for_nfsd(struct nameidata *, | | | @@ -280,27 +281,27 @@ int lookup_for_nfsd(struct nameidata *, |
280 | int lookup_for_nfsd_index(struct nameidata *, struct vnode *); | | 281 | int lookup_for_nfsd_index(struct nameidata *, struct vnode *); |
281 | int relookup(struct vnode *, struct vnode **, struct componentname *, int); | | 282 | int relookup(struct vnode *, struct vnode **, struct componentname *, int); |
282 | void cache_purge1(struct vnode *, const char *, size_t, int); | | 283 | void cache_purge1(struct vnode *, const char *, size_t, int); |
283 | #define PURGE_PARENTS 1 | | 284 | #define PURGE_PARENTS 1 |
284 | #define PURGE_CHILDREN 2 | | 285 | #define PURGE_CHILDREN 2 |
285 | #define cache_purge(vp) cache_purge1((vp),NULL,0,PURGE_PARENTS|PURGE_CHILDREN) | | 286 | #define cache_purge(vp) cache_purge1((vp),NULL,0,PURGE_PARENTS|PURGE_CHILDREN) |
286 | bool cache_lookup(struct vnode *, const char *, size_t, uint32_t, uint32_t, | | 287 | bool cache_lookup(struct vnode *, const char *, size_t, uint32_t, uint32_t, |
287 | int *, struct vnode **); | | 288 | int *, struct vnode **); |
288 | bool cache_lookup_raw(struct vnode *, const char *, size_t, uint32_t, | | 289 | bool cache_lookup_raw(struct vnode *, const char *, size_t, uint32_t, |
289 | int *, struct vnode **); | | 290 | int *, struct vnode **); |
290 | bool cache_lookup_linked(struct vnode *, const char *, size_t, | | 291 | bool cache_lookup_linked(struct vnode *, const char *, size_t, |
291 | struct vnode **, krwlock_t **, kauth_cred_t); | | 292 | struct vnode **, krwlock_t **, kauth_cred_t); |
292 | int cache_revlookup(struct vnode *, struct vnode **, char **, char *, | | 293 | int cache_revlookup(struct vnode *, struct vnode **, char **, char *, |
293 | bool, int); | | 294 | bool, accmode_t); |
294 | int cache_diraccess(struct vnode *, int); | | 295 | int cache_diraccess(struct vnode *, int); |
295 | void cache_enter(struct vnode *, struct vnode *, | | 296 | void cache_enter(struct vnode *, struct vnode *, |
296 | const char *, size_t, uint32_t); | | 297 | const char *, size_t, uint32_t); |
297 | void cache_enter_id(struct vnode *, mode_t, uid_t, gid_t, bool); | | 298 | void cache_enter_id(struct vnode *, mode_t, uid_t, gid_t, bool); |
298 | bool cache_have_id(struct vnode *); | | 299 | bool cache_have_id(struct vnode *); |
299 | void cache_vnode_init(struct vnode * ); | | 300 | void cache_vnode_init(struct vnode * ); |
300 | void cache_vnode_fini(struct vnode * ); | | 301 | void cache_vnode_fini(struct vnode * ); |
301 | void cache_cpu_init(struct cpu_info *); | | 302 | void cache_cpu_init(struct cpu_info *); |
302 | | | 303 | |
303 | void nchinit(void); | | 304 | void nchinit(void); |
304 | void namecache_count_pass2(void); | | 305 | void namecache_count_pass2(void); |
305 | void namecache_count_2passes(void); | | 306 | void namecache_count_2passes(void); |
306 | void cache_purgevfs(struct mount *); | | 307 | void cache_purgevfs(struct mount *); |