Espresso 0.0.2c
This commit is contained in:
37
include/fs/ekfs.h
Normal file
37
include/fs/ekfs.h
Normal file
@ -0,0 +1,37 @@
|
||||
//#ifndef _ESPRESSO_KERNEL_FS_H
|
||||
#if 0
|
||||
#define _ESPRESSO_KERNEL_FS_H
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#define EKFS_FILENAME_MAX_LEN 64
|
||||
|
||||
enum {
|
||||
EKFS_E_FILETOOSMALL = -16;
|
||||
};
|
||||
|
||||
struct ekfs_inode {
|
||||
char i_name[EKFS_FILENAME_MAX_LEN];
|
||||
|
||||
uint64_t i_start; /* LBA48 */
|
||||
size_t i_len; /* rounded up to the nearest multiple of 512 */
|
||||
} __attribute__((packed));
|
||||
|
||||
struct ekfs_ops {
|
||||
int (*read)(struct ekfs_file*, void*, size_t);
|
||||
int (*write)(struct ekfs_file*, void*, size_t);
|
||||
};
|
||||
|
||||
struct ekfs_file {
|
||||
struct ekfs_inode* f_inode;
|
||||
|
||||
size_t f_offset;
|
||||
size_t f_refcount;
|
||||
|
||||
struct ekfs_ops f_ops;
|
||||
};
|
||||
|
||||
|
||||
int ekfs_read(struct ekfs_file* __f, void* __b, size_t __l);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user