aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-02-28 21:21:32 -0500
committerIan Moffett <ian@osmora.org>2024-02-28 21:21:32 -0500
commitffb562a02b11ca3e879cc5ed3da2e0d3ffacb6e9 (patch)
treeda8d5c96b99565894883dfa5d6358053061ca638 /sys/kern
parentc2f513c8afdaab574143361dca5056cfa5ff4ad7 (diff)
kernel: vfs: Add more documentation
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_cache.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 44a8e27..1e051df 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -37,6 +37,15 @@
static struct mountlist_entry *mountlist = NULL;
+/*
+ * Cache a mountpoint
+ *
+ * @mp: Mountpoint to cache
+ * @path: Path this mountpoint belongs to
+ *
+ * If this cache entry already exists, -EEXIST
+ * will be returned.
+ */
int
vfs_cache_mp(struct mount *mp, const char *path)
{
@@ -59,6 +68,16 @@ vfs_cache_mp(struct mount *mp, const char *path)
return 0;
}
+/*
+ * Fetch mountpoint from cache
+ *
+ * @path: Path of target mountpoint
+ * @mp: Pointer of variable where mountpoint fetched will
+ * be stored
+ *
+ * Returns 0 upon a cache hit, on a cache miss this
+ * function returns -ENOENT.
+ */
int
vfs_cache_fetch_mp(const char *path, struct mount **mp)
{
@@ -84,6 +103,9 @@ vfs_cache_fetch_mp(const char *path, struct mount **mp)
return -ENOENT;
}
+/*
+ * Init all caches
+ */
void
vfs_init_cache(void)
{