Lines Matching defs:namecache

101  * Entries are described by "struct namecache" objects and stored in a hash
141 * different files don't suffer any scalability problems in the namecache.
197 * names get duplicated -- kept by filesystem itself and namecache separately
198 * - struct namecache has a fixed size and comes in 2 variants, often wasting
297 SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *",
299 SDT_PROBE_DEFINE3(vfs, namecache, enter, duplicate, "struct vnode *", "char *",
301 SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *",
303 SDT_PROBE_DEFINE2(vfs, namecache, fullpath_smr, hit, "struct vnode *",
305 SDT_PROBE_DEFINE4(vfs, namecache, fullpath_smr, miss, "struct vnode *",
306 "struct namecache *", "int", "int");
307 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *");
308 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *",
310 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *");
311 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int",
313 SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *",
315 SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negative,
317 SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *",
319 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *",
321 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *",
323 SDT_PROBE_DEFINE3(vfs, namecache, purge, done, "struct vnode *", "size_t", "size_t");
324 SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int");
325 SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *");
326 SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *");
327 SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *",
329 SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *",
331 SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *",
333 SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t");
352 struct namecache {
353 LIST_ENTRY(namecache) nc_src; /* source vnode list */
354 TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */
355 CK_SLIST_ENTRY(namecache) nc_hash;/* hash chain */
367 * struct namecache_ts repeats struct namecache layout up to the
369 * struct namecache_ts is used in place of struct namecache when time(s) need
381 struct namecache nc_nc;
384 TAILQ_HEAD(cache_freebatch, namecache);
396 * 4.4 BSD codebase. Later on struct namecache was tweaked to become
415 #define CACHE_ZONE_SMALL_SIZE (offsetof(struct namecache, nc_name) + CACHE_PATH_CUTOFF + 1)
417 #define CACHE_ZONE_LARGE_SIZE (offsetof(struct namecache, nc_name) + NAME_MAX + 1 + CACHE_LARGE_PAD)
429 * Flags in namecache.nc_flag
453 cache_ncp_invalidate(struct namecache *ncp)
469 struct namecache *_ncp = (ncp); \
481 struct namecache *_ncp = (ncp); \
496 "Total namecache capacity");
500 "Size factor for namecache");
504 "Ratio of negative namecache entries");
507 * Negative entry % of namecache capacity above which automatic eviction is allowed.
522 static __read_mostly CK_SLIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */
525 "Size of namecache hash table");
539 TAILQ_HEAD(, namecache) nl_list;
540 TAILQ_HEAD(, namecache) nl_hotlist;
547 NCP2NEGLIST(struct namecache *ncp)
554 NCP2NEGSTATE(struct namecache *ncp)
578 cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp)
597 "VFS namecache enabled");
601 SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, SYSCTL_NULL_INT_PTR,
602 sizeof(struct namecache), "sizeof(struct namecache)");
618 STATNODE_COUNTER(heldvnodes, numcachehv, "Number of namecache entries with vnodes held");
654 static void cache_zap_locked(struct namecache *ncp);
730 SDT_PROBE1(vfs, namecache, symlink, alloc__fail, size);
753 static struct namecache *
757 struct namecache *ncp;
775 cache_free_uma(struct namecache *ncp)
793 static struct namecache *
799 * Avoid blowout in namecache entries.
823 cache_free(struct namecache *ncp)
837 struct namecache *ncp, *nnp;
852 SDT_PROBE1(vfs, namecache, purge, batch, i);
917 NCP2BUCKET(struct namecache *ncp)
926 NCP2BUCKETLOCK(struct namecache *ncp)
936 cache_assert_bucket_locked(struct namecache *ncp)
945 cache_assert_bucket_unlocked(struct namecache *ncp)
1123 "I", "Negative entry \% of namecache capacity above which automatic eviction is allowed");
1137 struct namecache *ncp;
1171 struct namecache *ncp;
1222 * comment ends up with 2.6M namecache entries in total, 1.2M of which are
1280 cache_neg_init(struct namecache *ncp)
1294 cache_neg_hit_prep(struct namecache *ncp)
1318 cache_neg_hit_finish(struct namecache *ncp)
1321 SDT_PROBE2(vfs, namecache, lookup, hit__negative, ncp->nc_dvp, ncp->nc_name);
1329 cache_neg_promote_locked(struct namecache *ncp)
1349 cache_neg_demote_locked(struct namecache *ncp)
1376 struct namecache *oncp, uint32_t hash)
1378 struct namecache *ncp;
1445 cache_neg_promote(struct namecache *ncp)
1456 cache_neg_insert(struct namecache *ncp)
1470 cache_neg_remove(struct namecache *ncp)
1504 static struct namecache *
1507 struct namecache *ncp, *lncp;
1534 struct namecache *ncp, *ncp2;
1585 SDT_PROBE2(vfs, namecache, evict_negative, done, ncp->nc_dvp,
1629 * Removes a namecache entry from cache, whether it contains an actual
1633 cache_zap_locked(struct namecache *ncp)
1649 CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash);
1651 SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp);
1657 SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name);
1673 cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp)
1688 cache_zap_locked_vnode_kl2(struct namecache *ncp, struct vnode *vp,
1750 cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp,
1754 struct namecache *rncp;
1792 cache_zap_locked_bucket(struct namecache *ncp, struct componentname *cnp,
1819 struct namecache *ncp;
1836 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1853 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1891 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1896 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1907 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp);
1938 struct namecache *ncp;
1956 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, "..");
1969 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", *vpp);
2060 struct namecache *ncp;
2083 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
2093 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2137 struct namecache *ncp;
2178 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
2189 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2371 struct namecache *ncp;
2414 struct namecache *ncp;
2460 struct namecache *ncp;
2491 struct namecache *ncp, *n2, *ndd;
2542 * namecache entry as possible before acquiring the lock.
2607 SDT_PROBE3(vfs, namecache, enter, duplicate, dvp, ncp->nc_name,
2662 SDT_PROBE3(vfs, namecache, enter, done, dvp, ncp->nc_name,
2668 SDT_PROBE2(vfs, namecache, enter_negative, done, dvp,
2673 * Insert the new namecache entry into the appropriate chain
2881 struct namecache *ncp;
2902 * None of the namecache entries in the table can be removed
2914 CK_SLIST_REMOVE(&old_nchashtbl[i], ncp, namecache, nc_hash);
2934 struct namecache *ncp;
2986 SDT_PROBE1(vfs, namecache, purge, done, vp);
3025 struct namecache *ncp, *nnp;
3028 SDT_PROBE1(vfs, namecache, purge_negative, done, vp);
3097 struct namecache *ncp;
3154 SDT_PROBE3(vfs, namecache, purgevfs, done, mp, visited, purged);
3382 static struct namecache *
3385 struct namecache *ncp;
3399 struct namecache *ncp;
3419 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3425 SDT_PROBE3(vfs, namecache, fullpath, hit, ncp->nc_dvp,
3434 SDT_PROBE1(vfs, namecache, fullpath, miss, vp);
3442 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3451 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3464 * The name of the directory can always be found in the namecache or fetched
3497 SDT_PROBE1(vfs, namecache, fullpath, entry, vp);
3502 * since it is either found in namecache or obtained
3522 SDT_PROBE3(vfs, namecache, fullpath, return,
3539 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3552 SDT_PROBE3(vfs, namecache, fullpath, return, ENOMEM,
3562 SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, *retbuf);
3574 * - namecache is not mandatory, meaning names are not guaranteed to be added
3594 struct namecache *ncp;
3711 SDT_PROBE2(vfs, namecache, fullpath_smr, hit, startvp, *retbuf);
3716 SDT_PROBE4(vfs, namecache, fullpath_smr, miss, startvp, ncp, reason, i);
3756 * Since the namecache does not track hardlinks, the caller is expected to
3843 struct namecache *ncp;
3868 struct namecache *ncp;
3896 * because it falls back to the ".." lookup if the namecache lookup fails.
4031 struct namecache *ncp;
4557 cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp,
4693 * They want to possibly modify the state of the namecache.
5264 SDT_PROBE3(vfs, namecache, lookup, hit, fpl->dvp, ".", fpl->dvp);
5278 struct namecache *ncp;
5356 cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash)
5531 struct namecache *ncp;
5579 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp);
5958 struct namecache *ncp;