bool success = false;
ASSERT (length >= 0);
+
+ /* If this assertion fails, the inode structure is not exactly
+ one sector in size, and you should fix that. */
ASSERT (sizeof *disk_inode == DISK_SECTOR_SIZE);
disk_inode = calloc (1, sizeof *disk_inode);
/* Reopens and returns INODE. */
struct inode *
-inode_reopen (struct inode *inode)
+inode_reopen (struct inode *inode)
{
- if (inode != NULL)
+ if (inode != NULL)
inode->open_cnt++;
return inode;
}
+/* Returns INODE's inode number. */
+disk_sector_t
+inode_get_inumber (const struct inode *inode)
+{
+ return inode->sector;
+}
+
/* Closes INODE and writes it to disk.
If this was the last reference to INODE, frees its memory.
If INODE was also a removed inode, frees its blocks. */