61 lines
1.0 KiB
C
61 lines
1.0 KiB
C
// vfs.h
|
|
// Author: Josh Holtrop
|
|
// Date: 08/22/04
|
|
// Modified: 12/20/04
|
|
|
|
#ifndef __HOS_VFS_H__
|
|
#define __HOS_VFS_H__ __HOS_VFS_H__
|
|
|
|
#include "hos_defines.h"
|
|
#include "fs/devices.h"
|
|
|
|
#define FS_EXT2 1
|
|
#define VFS_MAX_FS 10
|
|
|
|
|
|
typedef struct
|
|
{
|
|
int refs;
|
|
void *super;
|
|
major_t major;
|
|
minor_t minor;
|
|
} vfs_mount_t;
|
|
|
|
typedef struct
|
|
{
|
|
void *(*mount_super)(major_t major, minor_t minor);
|
|
int (*mkfs)(major_t major, minor_t minor);
|
|
} vfs_fs_t;
|
|
|
|
struct vfs_node_s
|
|
{
|
|
char chr;
|
|
vfs_mount_t *mount;
|
|
struct vfs_node_s *up;
|
|
struct vfs_node_s *next;
|
|
struct vfs_node_s *down;
|
|
};
|
|
|
|
typedef struct vfs_node_s vfs_node_t;
|
|
|
|
typedef struct
|
|
{
|
|
major_t major;
|
|
minor_t minor;
|
|
int length;
|
|
} vfs_mount_match_t;
|
|
|
|
|
|
int vfs_init();
|
|
int vfs_mount(major_t maj, minor_t min, int fsType, char *mountPoint);
|
|
int vfs_register_fs(int fsn, vfs_fs_t *fs);
|
|
int vfs_add_mount(vfs_mount_t *mnt, char *mountPoint);
|
|
vfs_mount_t *vfs_find_mount(char *mountPoint);
|
|
vfs_mount_match_t vfs_get_rel_path(char *path);
|
|
/*void vfs_dump_tree();
|
|
void vfs_dump_node(vfs_node_t *node, int level);*/
|
|
|
|
|
|
#endif
|
|
|