/* * This file implements the Inode object and associated inode operations. Most * of the functions here are just wrappers for the file system specific inode * operations. They generally check if the operation exists and use it if it * does. If one does not exist, a function may implement a generic action, or * just simply return. They also perform the necessary validation to ensure the * operation can be called on the particular inode. */ #include #include #include #include static void inode_new(Object *); static void inode_delete(Object *); /* Inode object type */ ObjectType inodeType = { .size = sizeof(Inode), .new = inode_new, .delete = inode_delete, }; /* Create a new Inode */ static void inode_new(Object *obj) { Inode *inode = (void *) obj; inode->pages = create_list(&pageType); } /* Destroy an Inode */ static void inode_delete(Object *obj) { Inode *inode = (void *) obj; /* Remove inode from the SuperBlock's list */ // if (inode->super) // super_remove_inode(inode->super, inode); /* Clean cache */ destroy_list(inode->pages); }