From 6a0e4e3da5cf17635d094008c7cc5562b1f081e1 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 19 Sep 2025 00:42:14 -0400 Subject: kern: vfs: Add path component counter Signed-off-by: Ian Moffett --- src/sys/include/os/vfs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/sys/include') diff --git a/src/sys/include/os/vfs.h b/src/sys/include/os/vfs.h index ec7eb77..a46bb18 100644 --- a/src/sys/include/os/vfs.h +++ b/src/sys/include/os/vfs.h @@ -54,4 +54,15 @@ int vfs_init(void); */ int vfs_by_index(uint16_t index, struct fs_info **resp); +/* + * Count the number of components within a path and + * return a negative value if the path is invalid. + * + * @path: Path to check + * + * Returns the number of components on success, + * otherwise a less than zero value on failure. + */ +int vfs_cmp_cnt(const char *path); + #endif /* !_OS_VFS_H_ */ -- cgit v1.2.3