MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vfs_cache_lookup

Function vfs_cache_lookup

freebsd/kern/vfs_cache.c:2844–2873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2842 */
2843
2844int
2845vfs_cache_lookup(struct vop_lookup_args *ap)
2846{
2847 struct vnode *dvp;
2848 int error;
2849 struct vnode **vpp = ap->a_vpp;
2850 struct componentname *cnp = ap->a_cnp;
2851 int flags = cnp->cn_flags;
2852
2853 *vpp = NULL;
2854 dvp = ap->a_dvp;
2855
2856 if (dvp->v_type != VDIR)
2857 return (ENOTDIR);
2858
2859 if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) &&
2860 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
2861 return (EROFS);
2862
2863 error = vn_dir_check_exec(dvp, cnp);
2864 if (error != 0)
2865 return (error);
2866
2867 error = cache_lookup(dvp, vpp, cnp, NULL, NULL);
2868 if (error == 0)
2869 return (VOP_CACHEDLOOKUP(dvp, vpp, cnp));
2870 if (error == -1)
2871 return (0);
2872 return (error);
2873}
2874
2875/* Implementation of the getcwd syscall. */
2876int

Callers 2

zfs_lookup_internalFunction · 0.85
zfs_cache_lookupFunction · 0.85

Calls 2

vn_dir_check_execFunction · 0.85
cache_lookupFunction · 0.85

Tested by

no test coverage detected