-/* Opens the root directory and sets *DIRP to it or to a null
- pointer on failure. Return true if successful, false on
- failure. */
-bool
-dir_open_root (struct dir **dirp)
+/* Opens the root directory and returns a directory for it.
+ Return true if successful, false on failure. */
+struct dir *
+dir_open_root (void)
+{
+ return dir_open (inode_open (ROOT_DIR_SECTOR));
+}
+
+/* Opens and returns a new directory for the same inode as DIR.
+ Returns a null pointer on failure. */
+struct dir *
+dir_reopen (struct dir *dir)