2007-07-05 16:01:35 +00:00
|
|
|
#ifndef __FS_H
|
|
|
|
#define __FS_H
|
|
|
|
|
|
|
|
#include <driver.h>
|
|
|
|
|
|
|
|
#define FS_TYPE_CRAMFS 1
|
2007-07-05 16:01:37 +00:00
|
|
|
#define FS_TYPE_RAMFS 2
|
2007-07-05 16:01:35 +00:00
|
|
|
|
2007-07-05 16:01:37 +00:00
|
|
|
#define PATH_MAX 1024 /* include/linux/limits.h */
|
|
|
|
|
2007-07-05 16:01:35 +00:00
|
|
|
struct partition;
|
2007-07-05 16:01:37 +00:00
|
|
|
struct node_d;
|
|
|
|
|
|
|
|
struct dirent {
|
|
|
|
unsigned long mode;
|
|
|
|
unsigned long size;
|
|
|
|
char name[256];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dir {
|
|
|
|
struct device_d *dev;
|
|
|
|
struct fs_driver_d *fsdrv;
|
|
|
|
struct node_d *node;
|
|
|
|
struct dirent d;
|
|
|
|
void *priv; /* private data for the fs driver */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FS_DRIVER_NO_DEV 1
|
2007-07-05 16:01:35 +00:00
|
|
|
|
|
|
|
struct fs_driver_d {
|
|
|
|
ulong type;
|
|
|
|
char *name;
|
|
|
|
int (*load) (char *dst, struct device_d *dev, const char *filename);
|
|
|
|
int (*probe) (struct device_d *dev);
|
2007-07-05 16:01:37 +00:00
|
|
|
int (*create)(struct device_d *dev, const char *pathname, ulong type);
|
2007-07-05 16:01:37 +00:00
|
|
|
int (*mkdir)(struct device_d *dev, const char *pathname);
|
2007-07-05 16:01:37 +00:00
|
|
|
struct handle_d *(*open)(struct device_d *dev, const char *pathname);
|
2007-07-05 16:01:35 +00:00
|
|
|
|
2007-07-05 16:01:37 +00:00
|
|
|
struct dir* (*opendir)(struct device_d *dev, const char *pathname);
|
|
|
|
struct dirent* (*readdir)(struct device_d *dev, struct dir *dir);
|
|
|
|
int (*closedir)(struct device_d *dev, struct dir *dir);
|
|
|
|
|
2007-07-05 16:01:35 +00:00
|
|
|
struct driver_d drv;
|
2007-07-05 16:01:37 +00:00
|
|
|
|
|
|
|
unsigned long flags;
|
2007-07-05 16:01:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct fs_device_d {
|
|
|
|
struct device_d *parent; /* the device we are associated with */
|
|
|
|
struct device_d dev; /* our own device */
|
|
|
|
|
|
|
|
struct fs_driver_d *driver;
|
|
|
|
};
|
|
|
|
|
|
|
|
int register_filesystem(struct device_d *dev, char *fsname);
|
|
|
|
//int unregister_filesystem(struct device_d *dev);
|
|
|
|
|
|
|
|
int register_fs_driver(struct fs_driver_d *new_fs_drv);
|
|
|
|
|
2007-07-05 16:01:37 +00:00
|
|
|
char *mkmodestr(unsigned long mode, char *str);
|
|
|
|
|
2007-07-05 16:01:35 +00:00
|
|
|
#endif /* __FS_H */
|