-/* A directory. */
-struct dir
- {
- size_t entry_cnt; /* Number of entries. */
- struct dir_entry *entries; /* Array of entries. */
- };
-
-/* A single directory entry. */
-struct dir_entry
- {
- bool in_use; /* In use or free? */
- char name[NAME_MAX + 1]; /* Null terminated file name. */
- disk_sector_t filehdr_sector; /* Sector number of header. */
- };
-
-struct file;
-bool dir_init (struct dir *, size_t entry_cnt);
-void dir_destroy (struct dir *);
-void dir_read (struct dir *, struct file *);
-void dir_write (struct dir *, struct file *);
-bool dir_lookup (const struct dir *, const char *name, disk_sector_t *);
+struct inode;
+struct dir;
+bool dir_create (disk_sector_t sector, size_t entry_cnt);
+bool dir_open (struct inode *, struct dir **);
+bool dir_open_root (struct dir **);
+void dir_close (struct dir *);
+bool dir_lookup (const struct dir *, const char *name, struct inode **);