diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/include/sys/vfs.h | 6 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sys/include/sys/vfs.h b/sys/include/sys/vfs.h index 6b96cce..a684c3f 100644 --- a/sys/include/sys/vfs.h +++ b/sys/include/sys/vfs.h @@ -35,14 +35,20 @@ #include <sys/types.h> #if defined(_KERNEL) + +extern struct vnode *g_root_vnode; + void vfs_init(void); struct fs_info *vfs_byname(const char *name); +int vfs_vget(struct vnode *parent, const char *name, struct vnode **vp); struct vnode *vfs_path_to_node(const char *path); char *vfs_get_fname_at(const char *path, size_t idx); int vfs_rootname(const char *path, char **new_path); bool vfs_is_valid_path(const char *path); ssize_t vfs_hash_path(const char *path); +ssize_t vfs_read(struct vnode *vp, char *buf, size_t count); + #endif /* defined(_KERNEL) */ #endif /* !_SYS_VFS_H_ */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5740edf..5155c9a 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -216,3 +216,16 @@ vfs_rootname(const char *path, char **new_path) *new_path = tmp; return 0; } + + +int +vfs_vget(struct vnode *parent, const char *name, struct vnode **vp) +{ + return parent->vops->vget(parent, name, vp); +} + +ssize_t +vfs_read(struct vnode *vp, char *buf, size_t count) +{ + return vp->vops->read(vp, buf, count); +} |