2025-06-17 15:50:07 -05:00
|
|
|
#ifndef _VFS_H
|
|
|
|
|
#define _VFS_H
|
|
|
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
|
|
2025-07-01 20:39:38 -05:00
|
|
|
|
2026-06-05 16:14:14 -05:00
|
|
|
#define MAX_FDS 64
|
2025-06-17 15:50:07 -05:00
|
|
|
|
2026-06-05 16:14:14 -05:00
|
|
|
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;
|
|
|
|
|
};
|
2025-06-17 15:50:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|