From d516e8a27f1a52c92d39aada03ff92985b1fdf7e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 28 Jun 2024 23:19:09 -0400 Subject: kernel: vfs: Add vnode refcount Signed-off-by: Ian Moffett --- sys/include/sys/vnode.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h index 545fa2f..3f3b011 100644 --- a/sys/include/sys/vnode.h +++ b/sys/include/sys/vnode.h @@ -31,6 +31,7 @@ #define _SYS_VNODE_H_ #include +#include #include #if defined(_KERNEL) @@ -42,8 +43,11 @@ struct vnode { int flags; void *data; const struct vops *vops; + uint32_t refcount; }; +#define vfs_vref(VP) (atomic_inc_int(&(VP)->refcount)) + /* Vnode type flags */ #define VNON 0x00 /* Uninitialized */ #define VREG 0x01 /* Regular file */ -- cgit v1.2.3