aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-11-03 20:26:41 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2023-04-06 15:20:41 +0000
commit5f6df177758b9dff88e4b6069aeb2359e8b0c493 (patch)
tree977f1642ce48358fec1a9c3e55b613a2e0bf1155 /sys/kern/vfs_cache.c
parentc7f6c2a50b97411c7ef8652e77fabf799dfb8750 (diff)
downloadsrc-5f6df177758b9dff88e4b6069aeb2359e8b0c493.tar.gz
src-5f6df177758b9dff88e4b6069aeb2359e8b0c493.zip
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index cc93158078d3..2ffa48f12299 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -3957,6 +3957,40 @@ static int cache_fast_lookup = 1;
#define CACHE_FPL_FAILED -2020
void
+cache_vop_vector_register(struct vop_vector *v)
+{
+ size_t ops;
+
+ ops = 0;
+ if (v->vop_fplookup_vexec != NULL) {
+ ops++;
+ }
+ if (v->vop_fplookup_symlink != NULL) {
+ ops++;
+ }
+
+ if (ops == 2) {
+ return;
+ }
+
+ if (ops == 0) {
+ v->vop_fplookup_vexec = VOP_PANIC;
+ v->vop_fplookup_symlink = VOP_PANIC;
+ return;
+ }
+
+ printf("%s: invalid vop vector %p -- either all or none fplookup vops "
+ "need to be provided", __func__, v);
+ if (v->vop_fplookup_vexec == NULL) {
+ printf("%s: missing vop_fplookup_vexec\n", __func__);
+ }
+ if (v->vop_fplookup_symlink == NULL) {
+ printf("%s: missing vop_fplookup_symlink\n", __func__);
+ }
+ panic("bad vop vector %p", v);
+}
+
+void
cache_fast_lookup_enabled_recalc(void)
{
int lookup_flag;