| 4011 | } |
| 4012 | |
| 4013 | static bool |
| 4014 | cache_can_fplookup(struct cache_fpl *fpl) |
| 4015 | { |
| 4016 | struct nameidata *ndp; |
| 4017 | struct componentname *cnp; |
| 4018 | struct thread *td; |
| 4019 | |
| 4020 | ndp = fpl->ndp; |
| 4021 | cnp = fpl->cnp; |
| 4022 | td = cnp->cn_thread; |
| 4023 | |
| 4024 | if (!atomic_load_char(&cache_fast_lookup_enabled)) { |
| 4025 | cache_fpl_aborted_early(fpl); |
| 4026 | return (false); |
| 4027 | } |
| 4028 | if ((cnp->cn_flags & ~CACHE_FPL_SUPPORTED_CN_FLAGS) != 0) { |
| 4029 | cache_fpl_aborted_early(fpl); |
| 4030 | return (false); |
| 4031 | } |
| 4032 | if (IN_CAPABILITY_MODE(td)) { |
| 4033 | cache_fpl_aborted_early(fpl); |
| 4034 | return (false); |
| 4035 | } |
| 4036 | if (AUDITING_TD(td)) { |
| 4037 | cache_fpl_aborted_early(fpl); |
| 4038 | return (false); |
| 4039 | } |
| 4040 | if (ndp->ni_startdir != NULL) { |
| 4041 | cache_fpl_aborted_early(fpl); |
| 4042 | return (false); |
| 4043 | } |
| 4044 | return (true); |
| 4045 | } |
| 4046 | |
| 4047 | static int |
| 4048 | cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) |