From 3562e9781922827a5053317c2ecd89cf8da93ff3 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 31 Jul 2002 12:19:49 +0000 Subject: Introduce struct xvnode, which will be used instead of struct vnode for sysctl purposes. Also add two fields to struct vnode, v_cachedfs and v_cachedid, which hold the vnode's device and file id and are filled in by vn_open_cred() and vn_stat(). Sponsored by: DARPA, NAI Labs --- sys/kern/vfs_vnops.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/kern/vfs_vnops.c') diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 218dd72..c759196 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -209,6 +209,10 @@ restart: goto bad; } } + if ((error = VOP_GETATTR(vp, vap, cred, td)) == 0) { + vp->v_cachedfs = vap->va_fsid; + vp->v_cachedid = vap->va_fileid; + } if ((error = VOP_OPEN(vp, fmode, cred, td)) != 0) goto bad; /* @@ -567,6 +571,9 @@ vn_stat(vp, sb, td) if (error) return (error); + vp->v_cachedfs = vap->va_fsid; + vp->v_cachedid = vap->va_fileid; + /* * Zero the spare stat fields */ -- cgit v1.1