Lines Matching defs:namecache
101 * Entries are described by "struct namecache" objects and stored in a hash
144 * different files don't suffer any scalability problems in the namecache
204 * names get duplicated -- kept by filesystem itself and namecache separately
209 * This would not be a factor if namecache entries could persist without vnodes.
210 * - struct namecache has a fixed size and comes in 2 variants, often wasting
316 SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *",
318 SDT_PROBE_DEFINE3(vfs, namecache, enter, duplicate, "struct vnode *", "char *",
320 SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *",
322 SDT_PROBE_DEFINE2(vfs, namecache, fullpath_smr, hit, "struct vnode *",
324 SDT_PROBE_DEFINE4(vfs, namecache, fullpath_smr, miss, "struct vnode *",
325 "struct namecache *", "int", "int");
326 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *");
327 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *",
329 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *");
330 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int",
332 SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *",
334 SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negative,
336 SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *",
338 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *",
340 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *",
342 SDT_PROBE_DEFINE3(vfs, namecache, purge, done, "struct vnode *", "size_t", "size_t");
343 SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int");
344 SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *");
345 SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *");
346 SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *",
348 SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *",
350 SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *",
352 SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t");
372 struct namecache {
373 LIST_ENTRY(namecache) nc_src; /* source vnode list */
374 TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */
375 CK_SLIST_ENTRY(namecache) nc_hash;/* hash chain */
387 * struct namecache_ts repeats struct namecache layout up to the
389 * struct namecache_ts is used in place of struct namecache when time(s) need
401 struct namecache nc_nc;
404 TAILQ_HEAD(cache_freebatch, namecache);
416 * 4.4 BSD codebase. Later on struct namecache was tweaked to become
435 #define CACHE_ZONE_SMALL_SIZE (offsetof(struct namecache, nc_name) + CACHE_PATH_CUTOFF + 1)
437 #define CACHE_ZONE_LARGE_SIZE (offsetof(struct namecache, nc_name) + NAME_MAX + 1 + CACHE_LARGE_PAD)
449 * Flags in namecache.nc_flag
473 cache_ncp_invalidate(struct namecache *ncp)
486 cache_ncp_match(struct namecache *ncp, struct vnode *dvp,
501 struct namecache *_ncp = (ncp); \
513 struct namecache *_ncp = (ncp); \
528 "Total namecache capacity");
532 "Size factor for namecache");
536 "Ratio of negative namecache entries");
539 * Negative entry % of namecache capacity above which automatic eviction is allowed.
554 static __read_mostly CK_SLIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */
557 "Size of namecache hash table");
571 TAILQ_HEAD(, namecache) nl_list;
572 TAILQ_HEAD(, namecache) nl_hotlist;
579 NCP2NEGLIST(struct namecache *ncp)
586 NCP2NEGSTATE(struct namecache *ncp)
610 * Search the hash table for a namecache entry. Either the corresponding bucket
613 static struct namecache *
616 struct namecache *ncp;
628 cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp)
647 "VFS namecache enabled");
651 SYSCTL_SIZEOF_STRUCT(namecache);
667 STATNODE_COUNTER(heldvnodes, numcachehv, "Number of namecache entries with vnodes held");
703 static void cache_zap_locked(struct namecache *ncp);
779 SDT_PROBE1(vfs, namecache, symlink, alloc__fail, size);
802 static struct namecache *
806 struct namecache *ncp;
824 cache_free_uma(struct namecache *ncp)
842 static struct namecache *
848 * Avoid blowout in namecache entries.
872 cache_free(struct namecache *ncp)
886 struct namecache *ncp, *nnp;
901 SDT_PROBE1(vfs, namecache, purge, batch, i);
966 NCP2BUCKET(struct namecache *ncp)
975 NCP2BUCKETLOCK(struct namecache *ncp)
985 cache_assert_bucket_locked(struct namecache *ncp)
994 cache_assert_bucket_unlocked(struct namecache *ncp)
1172 "I", "Negative entry \% of namecache capacity above which automatic eviction is allowed");
1186 struct namecache *ncp;
1220 struct namecache *ncp;
1271 * comment ends up with 2.6M namecache entries in total, 1.2M of which are
1329 cache_neg_init(struct namecache *ncp)
1343 cache_neg_hit_prep(struct namecache *ncp)
1367 cache_neg_hit_finish(struct namecache *ncp)
1370 SDT_PROBE2(vfs, namecache, lookup, hit__negative, ncp->nc_dvp, ncp->nc_name);
1378 cache_neg_promote_locked(struct namecache *ncp)
1398 cache_neg_demote_locked(struct namecache *ncp)
1425 struct namecache *oncp, uint32_t hash)
1427 struct namecache *ncp;
1493 cache_neg_promote(struct namecache *ncp)
1504 cache_neg_insert(struct namecache *ncp)
1518 cache_neg_remove(struct namecache *ncp)
1552 static struct namecache *
1555 struct namecache *ncp, *lncp;
1582 struct namecache *ncp, *ncp2;
1633 SDT_PROBE2(vfs, namecache, evict_negative, done, ncp->nc_dvp,
1677 * Removes a namecache entry from cache, whether it contains an actual
1681 cache_zap_locked(struct namecache *ncp)
1697 CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash);
1699 SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp);
1705 SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name);
1721 cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp)
1736 cache_zap_locked_vnode_kl2(struct namecache *ncp, struct vnode *vp,
1798 cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp,
1802 struct namecache *rncp;
1837 cache_zap_locked_bucket(struct namecache *ncp, struct componentname *cnp,
1864 struct namecache *ncp;
1881 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1898 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1930 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1935 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1946 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp);
1977 struct namecache *ncp;
1995 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, "..");
2008 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", *vpp);
2099 struct namecache *ncp;
2117 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
2127 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2171 struct namecache *ncp;
2207 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
2218 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2400 struct namecache *ncp;
2443 struct namecache *ncp;
2489 struct namecache *ncp;
2520 struct namecache *ncp, *n2, *ndd;
2570 * namecache entry as possible before acquiring the lock.
2635 SDT_PROBE3(vfs, namecache, enter, duplicate, dvp, ncp->nc_name,
2689 SDT_PROBE3(vfs, namecache, enter, done, dvp, ncp->nc_name,
2695 SDT_PROBE2(vfs, namecache, enter_negative, done, dvp,
2700 * Insert the new namecache entry into the appropriate chain
2908 struct namecache *ncp;
2929 * None of the namecache entries in the table can be removed
2941 CK_SLIST_REMOVE(&old_nchashtbl[i], ncp, namecache, nc_hash);
2961 struct namecache *ncp;
3013 SDT_PROBE1(vfs, namecache, purge, done, vp);
3052 struct namecache *ncp, *nnp;
3055 SDT_PROBE1(vfs, namecache, purge_negative, done, vp);
3124 struct namecache *ncp;
3178 SDT_PROBE3(vfs, namecache, purgevfs, done, mp, visited, purged);
3442 static struct namecache *
3445 struct namecache *ncp;
3459 struct namecache *ncp;
3479 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3485 SDT_PROBE3(vfs, namecache, fullpath, hit, ncp->nc_dvp,
3494 SDT_PROBE1(vfs, namecache, fullpath, miss, vp);
3502 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3511 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3524 * The name of the directory can always be found in the namecache or fetched
3557 SDT_PROBE1(vfs, namecache, fullpath, entry, vp);
3562 * since it is either found in namecache or obtained
3582 SDT_PROBE3(vfs, namecache, fullpath, return,
3599 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3612 SDT_PROBE3(vfs, namecache, fullpath, return, ENOMEM,
3622 SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, *retbuf);
3634 * - namecache is not mandatory, meaning names are not guaranteed to be added
3654 struct namecache *ncp;
3771 SDT_PROBE2(vfs, namecache, fullpath_smr, hit, startvp, *retbuf);
3776 SDT_PROBE4(vfs, namecache, fullpath_smr, miss, startvp, ncp, reason, i);
3816 * Since the namecache does not track hardlinks, the caller is expected to
3903 struct namecache *ncp;
3928 struct namecache *ncp;
3956 * because it falls back to the ".." lookup if the namecache lookup fails.
4080 struct namecache *ncp;
4141 struct namecache *ncp;
4673 cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp,
4809 * They want to possibly modify the state of the namecache.
5380 SDT_PROBE3(vfs, namecache, lookup, hit, fpl->dvp, ".", fpl->dvp);
5393 struct namecache *ncp;
5461 cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash)
5636 struct namecache *ncp;
5679 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp);
6058 struct namecache *ncp;