svn commit: r195886 - projects/libprocstat/usr.bin/fstat
Stanislav Sedov
stas at FreeBSD.org
Sun Jul 26 08:18:40 UTC 2009
Author: stas
Date: Sun Jul 26 08:18:40 2009
New Revision: 195886
URL: http://svn.freebsd.org/changeset/base/195886
Log:
- Use getvnodemount and getvnodedata wrapper functions instead of direct
access to vnode.
Modified:
projects/libprocstat/usr.bin/fstat/common_kvm.c
projects/libprocstat/usr.bin/fstat/common_kvm.h
projects/libprocstat/usr.bin/fstat/msdosfs.c
Modified: projects/libprocstat/usr.bin/fstat/common_kvm.c
==============================================================================
--- projects/libprocstat/usr.bin/fstat/common_kvm.c Sun Jul 26 08:14:01 2009 (r195885)
+++ projects/libprocstat/usr.bin/fstat/common_kvm.c Sun Jul 26 08:18:40 2009 (r195886)
@@ -111,16 +111,16 @@ devfs_filestat(kvm_t *kd, struct vnode *
struct devfs_dirent devfs_dirent;
struct mount mount;
- if (!kvm_read_all(kd, (unsigned long)vp->v_data, &devfs_dirent,
+ if (!kvm_read_all(kd, (unsigned long)getvnodedata(vp), &devfs_dirent,
sizeof(devfs_dirent))) {
warnx("can't read devfs_dirent at %p",
(void *)vp->v_data);
return (1);
}
- if (!kvm_read_all(kd, (unsigned long)vp->v_mount, &mount,
+ if (!kvm_read_all(kd, (unsigned long)getvnodemount(vp), &mount,
sizeof(mount))) {
warnx("can't read mount at %p",
- (void *)vp->v_mount);
+ (void *)getvnodemount(vp));
return (1);
}
vn->vn_fsid = (long)mount.mnt_stat.f_fsid.val[0];
@@ -194,7 +194,6 @@ dev2udev(kvm_t *kd, struct cdev *dev)
}
}
-#ifdef ZFS
void *
getvnodedata(struct vnode *vp)
{
@@ -206,4 +205,3 @@ getvnodemount(struct vnode *vp)
{
return (vp->v_mount);
}
-#endif
Modified: projects/libprocstat/usr.bin/fstat/common_kvm.h
==============================================================================
--- projects/libprocstat/usr.bin/fstat/common_kvm.h Sun Jul 26 08:14:01 2009 (r195885)
+++ projects/libprocstat/usr.bin/fstat/common_kvm.h Sun Jul 26 08:18:40 2009 (r195886)
@@ -42,10 +42,8 @@ int isofs_filestat(kvm_t *kd, struct vno
int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
int nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
-#ifdef ZFS
int zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
void *getvnodedata(struct vnode *vp);
struct mount *getvnodemount(struct vnode *vp);
-#endif
#endif /* __COMMON_KVM_H__ */
Modified: projects/libprocstat/usr.bin/fstat/msdosfs.c
==============================================================================
--- projects/libprocstat/usr.bin/fstat/msdosfs.c Sun Jul 26 08:14:01 2009 (r195885)
+++ projects/libprocstat/usr.bin/fstat/msdosfs.c Sun Jul 26 08:18:40 2009 (r195886)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
* VTODE is defined in denode.h only if _KERNEL is defined, but that leads to
* header explosion
*/
-#define VTODE(vp) ((struct denode *)(vp)->v_data)
+#define VTODE(vp) ((struct denode *)getvnodedata(vp))
#include "libprocstat.h"
#include "common_kvm.h"
More information about the svn-src-projects
mailing list