#include <vm/vm_object.h>
#include <vm/vm_pager.h>
#include <vm/vnode_pager.h>
+#include <sys/vmmeter.h>
extern int afs_pbuf_freecnt;
#define GETNAME() \
#define AFS_VM_OBJECT_WUNLOCK(o) VM_OBJECT_UNLOCK(o)
#endif
+#ifdef VM_CNT_ADD
+# define AFS_VM_CNT_ADD(var, x) VM_CNT_ADD(var, x)
+# define AFS_VM_CNT_INC(var) VM_CNT_INC(var)
+#else
+# define AFS_VM_CNT_ADD(var, x) PCPU_ADD(cnt.var, x)
+# define AFS_VM_CNT_INC(var) PCPU_INC(cnt.var)
+#endif
+
/*
* Mosty copied from sys/ufs/ufs/ufs_vnops.c:ufs_pathconf().
* We should know the correct answers to these questions with
kva = (vm_offset_t) bp->b_data;
pmap_qenter(kva, pages, npages);
- PCPU_INC(cnt.v_vnodein);
- PCPU_ADD(cnt.v_vnodepgsin, npages);
+ AFS_VM_CNT_INC(v_vnodein);
+ AFS_VM_CNT_ADD(v_vnodepgsin, npages);
#ifdef FBSD_VOP_GETPAGES_BUSIED
count = ctob(npages);
kva = (vm_offset_t) bp->b_data;
pmap_qenter(kva, ap->a_m, npages);
- PCPU_INC(cnt.v_vnodeout);
- PCPU_ADD(cnt.v_vnodepgsout, ap->a_count);
+ AFS_VM_CNT_INC(v_vnodeout);
+ AFS_VM_CNT_ADD(v_vnodepgsout, ap->a_count);
iov.iov_base = (caddr_t) kva;
iov.iov_len = ap->a_count;