File system project updates:
[pintos-anon] / src / filesys / inode.c
index 17f4b4680f656fdbda2e8344b36366ba478a6315..d890ed8d3c7f0375dc9f3a6a1178254d2c2db011 100644 (file)
@@ -143,13 +143,20 @@ inode_open (disk_sector_t sector)
 
 /* 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. */