summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2008-12-12 00:57:38 +0000
committermarcus <marcus@FreeBSD.org>2008-12-12 00:57:38 +0000
commit91e684d7f9814a84afd87b2fc49ddcf6b6099b3c (patch)
treeff54050fd05bb494abfb240c2cb4731c086eb403 /sys/kern/vfs_default.c
parent509ce401ea8d49b634f2041c35c407a0d4e7d980 (diff)
downloadFreeBSD-src-91e684d7f9814a84afd87b2fc49ddcf6b6099b3c.zip
FreeBSD-src-91e684d7f9814a84afd87b2fc49ddcf6b6099b3c.tar.gz
Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name
on a best-effort basis. Teach vn_fullpath to use this new VOP if a regular VFS cache lookup fails. This VOP is designed to supplement the VFS cache to provide a better chance that a vnode-to-name lookup will succeed. Currently, an implementation for devfs is being committed. The default implementation is to return ENOENT. A big thanks to kib for the mentorship on this, and to pho for running it through his stress test suite. Reviewed by: arch Approved by: kib
Diffstat (limited to 'sys/kern/vfs_default.c')
-rw-r--r--sys/kern/vfs_default.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index d46bf81..a3f3725 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -98,6 +98,7 @@ struct vop_vector default_vnodeops = {
.vop_revoke = VOP_PANIC,
.vop_strategy = vop_nostrategy,
.vop_unlock = vop_stdunlock,
+ .vop_vptocnp = VOP_ENOENT,
.vop_vptofh = vop_stdvptofh,
};
@@ -138,6 +139,13 @@ vop_einval(struct vop_generic_args *ap)
}
int
+vop_enoent(struct vop_generic_args *ap)
+{
+
+ return (ENOENT);
+}
+
+int
vop_null(struct vop_generic_args *ap)
{
OpenPOWER on IntegriCloud