From ffb562a02b11ca3e879cc5ed3da2e0d3ffacb6e9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 28 Feb 2024 21:21:32 -0500 Subject: kernel: vfs: Add more documentation Signed-off-by: Ian Moffett --- sys/kern/vfs_cache.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'sys/kern') 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) { -- cgit v1.2.3