/* Parse first extent. */
if (dir_rec->data_length_l > 0) {
+ assert(i->extent == NULL);
i->extent = alloc_extent();
i->extent->location = dir_rec->loc_extent_l +
dir_rec->ext_attr_rec_length;
(memcmp(dir_rec->file_id, extent_rec->file_id,
dir_rec->length_file_id) == 0)) {
/* Add the extent at the end of the linked list. */
+ assert(cur_extent->next == NULL);
cur_extent->next = alloc_extent();
cur_extent->next->location = dir_rec->loc_extent_l +
dir_rec->ext_attr_rec_length;
return OK;
}
+
+int check_inodes(void)
+{
+ /* Check whether there are no more inodes in use. Called on unmount. */
+ int i;
+
+ for (i = 0; i < NR_INODE_RECORDS; i++)
+ if (inodes[i].i_count > 0)
+ return FALSE;
+
+ return TRUE;
+}
release_vol_pri_desc(&v_pri); /* Release the super block */
bdev_close(fs_dev);
+
+ if (check_inodes() == FALSE)
+ printf("ISOFS: unmounting with in-use inodes!\n");
}
r = read_inode(dir_tmp, ldir_ptr->extent, pos, &pos);
if ((r != OK) || (pos >= ldir_ptr->i_stat.st_size)) {
put_inode(dir_tmp);
- return EINVAL;
+ return ENOENT;
}
+ /* Temporary fix for extent spilling */
+ put_inode(dir_tmp);
+ dir_tmp = alloc_inode();
+ /* End of fix */
r = read_inode(dir_tmp, ldir_ptr->extent, pos, &pos);
if ((r != OK) || (pos >= ldir_ptr->i_stat.st_size)) {
put_inode(dir_tmp);
- return EINVAL;
+ return ENOENT;
}
*numb = dir_tmp->i_stat.st_ino;
put_inode(dir_tmp);
r = read_inode(dir_tmp, ldir_ptr->extent, pos, &pos);
if ((r != OK) || (pos >= ldir_ptr->i_stat.st_size)) {
put_inode(dir_tmp);
- return EINVAL;
+ return ENOENT;
}
if ((strcmp(dir_tmp->i_name, string) == 0) ||
int check_dir_record(const struct iso9660_dir_record *d, size_t offset);
+int check_inodes(void);
+
/* link.c */
ssize_t fs_rdlink(ino_t ino_nr, struct fsdriver_data *data, size_t bytes);