- root = bluesky_new_inode(BLUESKY_ROOT_INUM, BLUESKY_DIRECTORY);
- root->nlink = 1;
- root->mode = 0755;
- bluesky_insert_inode(fs, root);
-
- BlueSkyInode *file;
- file = bluesky_new_inode(bluesky_fs_alloc_inode(fs), BLUESKY_REGULAR);
- file->nlink = 1;
- file->mode = 0755;
- bluesky_insert_inode(fs, file);
- bluesky_directory_insert(root, "demo", file->inum);
+ root = bluesky_get_inode(fs, BLUESKY_ROOT_INUM);
+ if (root == NULL) {
+ printf("Initializing fresh root inode...\n");
+ root = bluesky_new_inode(BLUESKY_ROOT_INUM, fs, BLUESKY_DIRECTORY);
+ root->nlink = 1;
+ root->mode = 0755;
+ bluesky_insert_inode(fs, root);
+ }
+
+ bluesky_debug_dump(fs);