+ return (error);
+}
+
+int
+namei_compound_available(vnode_t dp, struct nameidata *ndp)
+{
+ if ((ndp->ni_flag & NAMEI_COMPOUNDOPEN) != 0) {
+ return vnode_compound_open_available(dp);
+ }
+
+ return 0;
+}
+
+static int
+lookup_authorize_search(vnode_t dp, struct componentname *cnp, int dp_authorized_in_cache, vfs_context_t ctx)
+{
+#if !CONFIG_MACF
+#pragma unused(cnp)
+#endif
+
+ int error;
+
+ if (!dp_authorized_in_cache) {
+ error = vnode_authorize(dp, NULL, KAUTH_VNODE_SEARCH, ctx);
+ if (error)
+ return error;
+ }
+#if CONFIG_MACF
+ error = mac_vnode_check_lookup(ctx, dp, cnp);
+ if (error)
+ return error;
+#endif /* CONFIG_MACF */
+
+ return 0;
+}
+
+static void
+lookup_consider_update_cache(vnode_t dvp, vnode_t vp, struct componentname *cnp, int nc_generation)
+{
+ int isdot_or_dotdot;
+ isdot_or_dotdot = (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') || (cnp->cn_flags & ISDOTDOT);
+
+ if (vp->v_name == NULL || vp->v_parent == NULLVP) {
+ int update_flags = 0;
+
+ if (isdot_or_dotdot == 0) {
+ if (vp->v_name == NULL)
+ update_flags |= VNODE_UPDATE_NAME;
+ if (dvp != NULLVP && vp->v_parent == NULLVP)
+ update_flags |= VNODE_UPDATE_PARENT;
+
+ if (update_flags)
+ vnode_update_identity(vp, dvp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_hash, update_flags);
+ }
+ }
+ if ( (cnp->cn_flags & MAKEENTRY) && (vp->v_flag & VNCACHEABLE) && LIST_FIRST(&vp->v_nclinks) == NULL) {
+ /*
+ * missing from name cache, but should
+ * be in it... this can happen if volfs
+ * causes the vnode to be created or the
+ * name cache entry got recycled but the
+ * vnode didn't...
+ * check to make sure that ni_dvp is valid
+ * cache_lookup_path may return a NULL
+ * do a quick check to see if the generation of the
+ * directory matches our snapshot... this will get
+ * rechecked behind the name cache lock, but if it
+ * already fails to match, no need to go any further