diff options
author | phk <phk@FreeBSD.org> | 2004-11-10 07:25:37 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-10 07:25:37 +0000 |
commit | d09bec00987a11e098464964dcf3588f32dc7738 (patch) | |
tree | abedbcd117a38f3441536f989cc74f6cdc6ca825 | |
parent | cea50000575c49a4d1ad8fc023e281ede89058aa (diff) | |
download | FreeBSD-src-d09bec00987a11e098464964dcf3588f32dc7738.zip FreeBSD-src-d09bec00987a11e098464964dcf3588f32dc7738.tar.gz |
Pick up the inode number using VOP_GETATTR() rather than caching it
in all vnodes on the off chance that linprocfs needs it. If we can afford
to call vn_fullpath() we can afford the much cheaper VOP_GETATTR().
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 040c649..95cebb4 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -830,6 +830,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ino_t ino; int ref_count, shadow_count, flags; int error; + struct vnode *vp; + struct vattr vat; PROC_LOCK(p); error = p_candebug(td, p); @@ -858,13 +860,13 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) lobj = tobj; ino = 0; if (lobj) { + vp = lobj->handle; VM_OBJECT_LOCK(lobj); off = IDX_TO_OFF(lobj->size); if (lobj->type == OBJT_VNODE && lobj->handle) { - vn_fullpath(td, (struct vnode *)lobj->handle, - &name, &freename); - ino = ((struct vnode *) - lobj->handle)->v_cachedid; + vn_fullpath(td, vp, &name, &freename); + VOP_GETATTR(vp, &vat, td->td_ucred, td); + ino = vat.va_fileid; } flags = obj->flags; ref_count = obj->ref_count; |