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

Function cache_lookup_dot

freebsd/kern/vfs_cache.c:1690–1722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1688}
1689
1690static int __noinline
1691cache_lookup_dot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
1692 struct timespec *tsp, int *ticksp)
1693{
1694 int ltype;
1695
1696 *vpp = dvp;
1697 counter_u64_add(dothits, 1);
1698 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp);
1699 if (tsp != NULL)
1700 timespecclear(tsp);
1701 if (ticksp != NULL)
1702 *ticksp = ticks;
1703 vrefact(*vpp);
1704 /*
1705 * When we lookup "." we still can be asked to lock it
1706 * differently...
1707 */
1708 ltype = cnp->cn_lkflags & LK_TYPE_MASK;
1709 if (ltype != VOP_ISLOCKED(*vpp)) {
1710 if (ltype == LK_EXCLUSIVE) {
1711 vn_lock(*vpp, LK_UPGRADE | LK_RETRY);
1712 if (VN_IS_DOOMED((*vpp))) {
1713 /* forced unmount */
1714 vrele(*vpp);
1715 *vpp = NULL;
1716 return (ENOENT);
1717 }
1718 } else
1719 vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY);
1720 }
1721 return (-1);
1722}
1723
1724static int __noinline
1725cache_lookup_dotdot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,

Callers 1

cache_lookupFunction · 0.85

Calls 4

vn_lockFunction · 0.85
vrefactFunction · 0.70
vreleFunction · 0.70
counter_u64_addFunction · 0.50

Tested by

no test coverage detected