aboutsummaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/sysctl.h1
-rw-r--r--sys/include/sys/vnode.h15
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/include/sys/sysctl.h b/sys/include/sys/sysctl.h
index 0f1df26..9623137 100644
--- a/sys/include/sys/sysctl.h
+++ b/sys/include/sys/sysctl.h
@@ -39,6 +39,7 @@
#define KERN_OSTYPE 0
#define KERN_OSRELEASE 1
#define KERN_VERSION 2
+#define KERN_VCACHE_TYPE 3
/*
* Option types (i.e., int, string, etc) for
diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h
index 3f3b011..33d5b17 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/queue.h>
#include <sys/atomic.h>
#include <sys/sio.h>
@@ -44,10 +45,18 @@ struct vnode {
void *data;
const struct vops *vops;
uint32_t refcount;
+ TAILQ_ENTRY(vnode) vcache_link;
};
#define vfs_vref(VP) (atomic_inc_int(&(VP)->refcount))
+/* vcache types */
+#if defined(_KERNEL)
+#define VCACHE_TYPE_NONE 0
+#define VCACHE_TYPE_PROC 1
+#define VCACHE_TYPE_GLOBAL 2
+#endif /* KERNEL */
+
/* Vnode type flags */
#define VNON 0x00 /* Uninitialized */
#define VREG 0x01 /* Regular file */
@@ -86,6 +95,12 @@ struct vops {
extern struct vnode *g_root_vnode;
+int vfs_vcache_type(void);
+int vfs_vcache_migrate(int newtype);
+
+int vfs_vcache_enter(struct vnode *vp);
+struct vnode *vfs_recycle_vnode(void);
+
int vfs_alloc_vnode(struct vnode **res, int type);
int vfs_release_vnode(struct vnode *vp);