diff options
author | Ian Moffett <ian@osmora.org> | 2024-06-28 23:19:09 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-06-28 23:19:09 -0400 |
commit | d516e8a27f1a52c92d39aada03ff92985b1fdf7e (patch) | |
tree | e9a4808cf6e2bf2da26c237622ea262e3778b000 /sys/include | |
parent | bbc4eeea0da272c704f00a23fe08bc6ddc021922 (diff) |
kernel: vfs: Add vnode refcount
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/sys/vnode.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 <sys/types.h> +#include <sys/atomic.h> #include <sys/sio.h> #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 */ |