diff options
author | Ian Moffett <ian@osmora.org> | 2024-05-23 01:55:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-05-23 03:18:41 -0400 |
commit | 05eb9f648569d708e167272e04437466a2f0b594 (patch) | |
tree | 7649e305ff71dce593b7426fee0b676994aa080a /sys/vm/vm_obj.c | |
parent | e0b34937b1bd674c05d609331501f81740fbb87f (diff) |
kernel: vm: Keep track of vmobj count
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm/vm_obj.c')
-rw-r--r-- | sys/vm/vm_obj.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/vm/vm_obj.c b/sys/vm/vm_obj.c index 7487b47..8f34ff3 100644 --- a/sys/vm/vm_obj.c +++ b/sys/vm/vm_obj.c @@ -32,6 +32,8 @@ #include <sys/errno.h> #include <string.h> +static size_t obj_count = 0; + static void vm_set_pgops(struct vm_object *obj, struct vnode *vnode) { @@ -63,6 +65,7 @@ vm_obj_init(struct vm_object **res, struct vnode *vnode) vm_set_pgops(obj, vnode); *res = obj; + ++obj_count; return 0; } @@ -79,5 +82,12 @@ vm_obj_destroy(struct vm_object *obj) return -EBUSY; dynfree(obj); + --obj_count; return 0; } + +size_t +vm_obj_count(void) +{ + return obj_count; +} |