36 lines
488 B
C
36 lines
488 B
C
#ifndef _VFS_H
|
|
#define _VFS_H
|
|
|
|
#include <types.h>
|
|
|
|
|
|
#define MAX_FDS 64
|
|
|
|
struct file;
|
|
|
|
struct inode {
|
|
size_t size;
|
|
int permissions;
|
|
/* | | */
|
|
/* \/ FS-specific \/ */
|
|
union {
|
|
void* fs_data;
|
|
void* private_data;
|
|
};
|
|
};
|
|
|
|
struct file_ops {
|
|
int (*read)(struct file*, char*, size_t);
|
|
int (*write)(struct file*, const char*, size_t);
|
|
};
|
|
|
|
struct file {
|
|
struct inode* f_inode;
|
|
size_t f_offset;
|
|
size_t f_refcount;
|
|
const struct file_ops* f_ops;
|
|
};
|
|
|
|
|
|
#endif
|