#ifndef __FS_INODE_H #define __FS_INODE_H #include #define INODE_DIRECT 5 /* FIXME ! */ #define INODE_FIELDS 5 /* FIXME ! */ #define INODE_MAGIC 0xcafebad1 typedef uint32_t inode_t; enum file_type_e { FILET_REG, FILET_DIR, FILET_SPEC }; struct inode_desc_t { unsigned int volume; uint32_t magic_key; uint16_t size; enum file_type_e type; uint32_t ind_direct[INODE_DIRECT]; uint32_t ind_indirect; uint32_t ind_d_indirect; }; struct inode_desc_t new_inode(unsigned int volume, enum file_type_e t); void free_inode_blocks(struct inode_desc_t inode); uint32_t block_of_pos(struct inode_desc_t inode, unsigned int offset); uint32_t block_of_pos_alloc(struct inode_desc_t *inode, unsigned int offset, unsigned int filesize); #endif /* __FS_INODE_H */