$NetBSD: patch-ar,v 1.1.1.1 2004/04/02 12:10:18 jmmv Exp $ --- sysdeps/freebsd/procmem.c.orig Thu May 27 20:56:49 1999 +++ sysdeps/freebsd/procmem.c @@ -31,8 +31,12 @@ #include #include #include +#if defined(__NetBSD__) && (__NetBSD_Version__ < 105020000) #include #include +#else +#include +#endif #include #include @@ -43,9 +47,14 @@ #include #endif #include +#if defined(__NetBSD__) && (__NetBSD_Version__ < 105020000) #include +#else +#include +#endif -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +#if defined(__NetBSD__) && \ + (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000) /* Fixme ... */ #undef _KERNEL #define _UVM_UVM_AMAP_I_H_ 1 @@ -113,7 +122,6 @@ struct vmspace *vms, vmspace; #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) struct vnode vnode; - struct inode inode; #else struct vm_object object; #endif @@ -233,17 +241,27 @@ /* If the object is of type vnode, add its size */ #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) +#if defined(UVM_VNODE_VALID) if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) continue; +#endif if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || !vnode.v_data) continue; +#if (__NetBSD_Version__ >= 105250000) + /* Reference count must be at least two. */ + if (vnode.v_usecount <= 1) + continue; + + buf->share += pagetok (vnode.v_uobj.uo_npages) << LOG1024; +#else /* Reference count must be at least two. */ if (vnode.v_uvm.u_obj.uo_refs <= 1) continue; buf->share += pagetok (vnode.v_uvm.u_obj.uo_npages) << LOG1024; +#endif /* __NetBSD_Version__ >= 105250000 */ #endif #ifdef __FreeBSD__