Hi I'm working with OS161 and I'm trying to extend my inode structures so that when I write to disk, I write the first chunk of file data into the actual inode structure, because currently it's set up such that a large chunk of the structure is wasted.
struct sfs_inode {
u_int32_t sfi_size; /* Size of this file (bytes) */
u_int16_t sfi_type; /* One of SFS_TYPE_* above */
u_int16_t sfi_linkcount; /* Number of hard links to this file */
u_int32_t sfi_direct[SFS_NDIRECT]; /* Direct blocks */
u_int32_t sfi_indirect; /* Indirect block */
u_int32_t sfi_waste[128-3-SFS_NDIRECT]; /* unused space */
};
I'd like to replace the sfi_waste above with a char sfi_inlinedata[INLINE_SIZE]; so that my disk io will always write/read the first INLINE_SIZE of data to the sfs_inode struct. The following is the source I'm working from for the relevant io functions. I know I need to change the way that the offset maps to actual addresses in the io functions here, but I'm having trouble coming up with a concrete solution. https://github.com/rbui/projectJailBait/blob/master/os161-1.11/kern/fs/sfs/sfs_vnode.c
Any help would be much appreciated!