Lines Matching refs:namecache

107  * Entries are described by "struct namecache" objects and stored in a hash
147 * different files don't suffer any scalability problems in the namecache.
203 * names get duplicated -- kept by filesystem itself and namecache separately
204 * - struct namecache has a fixed size and comes in 2 variants, often wasting space.
214 SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *",
216 SDT_PROBE_DEFINE3(vfs, namecache, enter, duplicate, "struct vnode *", "char *",
218 SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *",
220 SDT_PROBE_DEFINE2(vfs, namecache, fullpath_smr, hit, "struct vnode *",
222 SDT_PROBE_DEFINE4(vfs, namecache, fullpath_smr, miss, "struct vnode *",
223 "struct namecache *", "int", "int");
224 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *");
225 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *",
227 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *");
228 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int",
230 SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *",
232 SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negative,
234 SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *",
236 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *",
238 SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *",
240 SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *");
241 SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int");
242 SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *");
243 SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *");
244 SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *",
246 SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *",
248 SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *",
250 SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t");
267 struct namecache {
268 LIST_ENTRY(namecache) nc_src; /* source vnode list */
269 TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */
270 CK_SLIST_ENTRY(namecache) nc_hash;/* hash chain */
282 * struct namecache_ts repeats struct namecache layout up to the
284 * struct namecache_ts is used in place of struct namecache when time(s) need
296 struct namecache nc_nc;
299 TAILQ_HEAD(cache_freebatch, namecache);
311 * 4.4 BSD codebase. Later on struct namecache was tweaked to become
330 #define CACHE_ZONE_SMALL_SIZE (offsetof(struct namecache, nc_name) + CACHE_PATH_CUTOFF + 1)
332 #define CACHE_ZONE_LARGE_SIZE (offsetof(struct namecache, nc_name) + NAME_MAX + 1 + CACHE_LARGE_PAD)
344 * Flags in namecache.nc_flag
368 cache_ncp_invalidate(struct namecache *ncp)
384 struct namecache *_ncp = (ncp); \
396 struct namecache *_ncp = (ncp); \
411 "Total namecache capacity");
415 "Size factor for namecache");
419 "Ratio of negative namecache entries");
422 * Negative entry % of namecache capacity above which automatic eviction is allowed.
437 static __read_mostly CK_SLIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */
440 "Size of namecache hash table");
462 TAILQ_HEAD(, namecache) nl_list;
463 TAILQ_HEAD(, namecache) nl_hotlist;
470 NCP2NEGLIST(struct namecache *ncp)
477 NCP2NEGSTATE(struct namecache *ncp)
501 cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp)
520 "VFS namecache enabled");
524 SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, SYSCTL_NULL_INT_PTR,
525 sizeof(struct namecache), "sizeof(struct namecache)");
541 STATNODE_COUNTER(heldvnodes, numcachehv, "Number of namecache entries with vnodes held");
583 static void cache_zap_locked(struct namecache *ncp);
661 SDT_PROBE1(vfs, namecache, symlink, alloc__fail, size);
684 static struct namecache *
688 struct namecache *ncp;
706 cache_free_uma(struct namecache *ncp)
724 static struct namecache *
730 * Avoid blowout in namecache entries.
754 cache_free(struct namecache *ncp)
768 struct namecache *ncp, *nnp;
783 SDT_PROBE1(vfs, namecache, purge, batch, i);
848 NCP2BUCKET(struct namecache *ncp)
857 NCP2BUCKETLOCK(struct namecache *ncp)
867 cache_assert_bucket_locked(struct namecache *ncp)
876 cache_assert_bucket_unlocked(struct namecache *ncp)
1034 "I", "Negative entry \% of namecache capacity above which automatic eviction is allowed");
1048 struct namecache *ncp;
1082 struct namecache *ncp;
1133 * comment ends up with 2.6M namecache entries in total, 1.2M of which are
1191 cache_neg_init(struct namecache *ncp)
1205 cache_neg_hit_prep(struct namecache *ncp)
1229 cache_neg_hit_finish(struct namecache *ncp)
1232 SDT_PROBE2(vfs, namecache, lookup, hit__negative, ncp->nc_dvp, ncp->nc_name);
1240 cache_neg_promote_locked(struct namecache *ncp)
1260 cache_neg_demote_locked(struct namecache *ncp)
1287 struct namecache *oncp, uint32_t hash)
1289 struct namecache *ncp;
1356 cache_neg_promote(struct namecache *ncp)
1367 cache_neg_insert(struct namecache *ncp)
1381 cache_neg_remove(struct namecache *ncp)
1415 static struct namecache *
1418 struct namecache *ncp, *lncp;
1445 struct namecache *ncp, *ncp2;
1496 SDT_PROBE2(vfs, namecache, evict_negative, done, ncp->nc_dvp,
1540 * Removes a namecache entry from cache, whether it contains an actual
1544 cache_zap_locked(struct namecache *ncp)
1560 CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash);
1562 SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp);
1568 SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name);
1584 cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp)
1599 cache_zap_locked_vnode_kl2(struct namecache *ncp, struct vnode *vp,
1661 cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp,
1665 struct namecache *rncp;
1692 cache_zap_locked_bucket(struct namecache *ncp, struct componentname *cnp,
1719 struct namecache *ncp;
1736 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1753 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1782 SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
1787 SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
1799 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp);
1830 struct namecache *ncp;
1849 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, "..");
1862 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", *vpp);
1953 struct namecache *ncp;
1976 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
1986 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2030 struct namecache *ncp;
2071 SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr);
2082 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp);
2264 struct namecache *ncp;
2307 struct namecache *ncp;
2353 struct namecache *ncp;
2384 struct namecache *ncp, *n2, *ndd;
2432 * namecache entry as possible before acquiring the lock.
2497 SDT_PROBE3(vfs, namecache, enter, duplicate, dvp, ncp->nc_name,
2552 SDT_PROBE3(vfs, namecache, enter, done, dvp, ncp->nc_name,
2558 SDT_PROBE2(vfs, namecache, enter_negative, done, dvp,
2563 * Insert the new namecache entry into the appropriate chain
2747 struct namecache *ncp;
2768 * None of the namecache entries in the table can be removed
2780 CK_SLIST_REMOVE(&old_nchashtbl[i], ncp, namecache, nc_hash);
2800 struct namecache *ncp;
2852 SDT_PROBE1(vfs, namecache, purge, done, vp);
2891 struct namecache *ncp, *nnp;
2894 SDT_PROBE1(vfs, namecache, purge_negative, done, vp);
2965 struct namecache *ncp;
2994 SDT_PROBE1(vfs, namecache, purgevfs, done, mp);
3188 static struct namecache *
3191 struct namecache *ncp;
3205 struct namecache *ncp;
3225 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3231 SDT_PROBE3(vfs, namecache, fullpath, hit, ncp->nc_dvp,
3240 SDT_PROBE1(vfs, namecache, fullpath, miss, vp);
3248 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3257 SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
3270 * The name of the directory can always be found in the namecache or fetched
3303 SDT_PROBE1(vfs, namecache, fullpath, entry, vp);
3308 * since it is either found in namecache or obtained
3328 SDT_PROBE3(vfs, namecache, fullpath, return,
3342 SDT_PROBE3(vfs, namecache, fullpath, return,
3352 SDT_PROBE3(vfs, namecache, fullpath, return, error,
3365 SDT_PROBE3(vfs, namecache, fullpath, return, ENOMEM,
3375 SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, *retbuf);
3387 * - namecache is not mandatory, meaning names are not guaranteed to be added
3407 struct namecache *ncp;
3524 SDT_PROBE2(vfs, namecache, fullpath_smr, hit, startvp, *retbuf);
3529 SDT_PROBE4(vfs, namecache, fullpath_smr, miss, startvp, ncp, reason, i);
3569 * Since the namecache does not track hardlinks, the caller is expected to first
3664 struct namecache *ncp;
3689 struct namecache *ncp;
3717 * because it falls back to the ".." lookup if the namecache lookup fails.
3787 struct namecache *ncp;
4237 cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp,
4373 * They want to possibly modify the state of the namecache.
4911 SDT_PROBE3(vfs, namecache, lookup, hit, fpl->dvp, ".", fpl->dvp);
4925 struct namecache *ncp;
4999 cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash)
5167 struct namecache *ncp;
5215 SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp);
5593 struct namecache *ncp;