Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F169452702
D14898.id40889.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14898.id40889.diff
View Options
Index: sys/kern/vfs_cache.c
===================================================================
--- sys/kern/vfs_cache.c
+++ sys/kern/vfs_cache.c
@@ -37,6 +37,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ddb.h"
#include "opt_ktrace.h"
#include <sys/param.h>
@@ -62,6 +63,10 @@
#include <sys/ktrace.h>
#endif
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
#include <vm/uma.h>
SDT_PROVIDER_DECLARE(vfs);
@@ -2527,3 +2532,68 @@
free(fbuf, M_TEMP);
return (error);
}
+
+#ifdef DDB
+static void
+db_print_nc_name(struct namecache *ncp)
+{
+ char *ncn;
+ int i;
+
+ if (ncp->nc_flag & NCF_TS) {
+ struct namecache_ts *ncp_ts;
+
+ ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc);
+ ncp = &ncp_ts->nc_nc;
+ }
+ ncn = ncp->nc_name;
+
+ for (i = 0; i < ncp->nc_nlen; i++)
+ printf("%c", *ncn++);
+}
+
+static void
+db_print_vpath(struct vnode *vp)
+{
+
+ while (vp != NULL) {
+ db_printf("%p: ", vp);
+ if (vp == rootvnode) {
+ db_printf("/");
+ vp = NULL;
+ } else {
+ if (vp->v_vflag & VV_ROOT) {
+ db_printf("<mount point>");
+ vp = vp->v_mount->mnt_vnodecovered;
+ } else {
+ struct namecache *ncp;
+
+ ncp = TAILQ_FIRST(&vp->v_cache_dst);
+ if (ncp != NULL) {
+ db_print_nc_name(ncp);
+ vp = ncp->nc_dvp;
+ } else {
+ vp = NULL;
+ }
+ }
+ }
+ db_printf("\n");
+ }
+
+ return;
+}
+
+DB_SHOW_COMMAND(vpath, db_show_vpath)
+{
+ struct vnode *vp;
+
+ if (!have_addr) {
+ db_printf("usage: show vpath <strcut vnode *>\n");
+ return;
+ }
+
+ vp = (struct vnode *)addr;
+ db_print_vpath(vp);
+}
+
+#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 2, 2:06 PM (3 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37970100
Default Alt Text
D14898.id40889.diff (1 KB)
Attached To
Mode
D14898: Implement DDB show vpath
Attached
Detach File
Event Timeline
Log In to Comment