vfs: add vfs_readdir

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-10 12:58:11 -04:00
commit 898570d0ca
4 changed files with 42 additions and 1 deletions

View file

@ -79,12 +79,18 @@ struct _fs {
struct fs_ops fs_ops;
};
struct dir_context {
void *cookie;
bool init;
};
void vfs_init(void);
void vfs_register(struct fs_driver *fs);
int vfs_open(const char *abs_path, dirent_t **out);
int vfs_openat(dirent_t *in, const char *name, dirent_t **out);
void vfs_close(dirent_t *dent);
int vfs_readdir(dirent_t *dir, struct dir_context *ctx, dirent_t **out);
int vfs_creat(dirent_t *parent, const char *name, u64 mode, int flags, dirent_t **out);
int vfs_unlink(dirent_t *parent, const char *name);
int vfs_mount(const char *mount_point, fs_t *fs_to_mount);