Get rid of file system "dump" operations because they weren't useful
[pintos-anon] / src / filesys / directory.h
index 4464d466baffa0b04fca022e8f9d72939f7b6884..c773887b6b57e920d59e7ddadf50502c7cf8fe30 100644 (file)
@@ -5,28 +5,15 @@
 #include <stddef.h>
 #include "devices/disk.h"
 
-/* Maximum length of a filename.
-   This is the traditional UNIX maximum.
-   (This macro name comes from POSIX.1.) */
+/* Maximum length of a file name component.
+   This is the traditional UNIX maximum length.
+   After directories are implemented, this maximum length may be
+   retained, but much longer full path names must be allowed. */
 #define NAME_MAX 14
 
-/* 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);
+struct dir *dir_create (size_t entry_cnt);
+size_t dir_size (size_t entry_cnt);
 void dir_destroy (struct dir *);
 void dir_read (struct dir *, struct file *);
 void dir_write (struct dir *, struct file *);
@@ -34,6 +21,5 @@ bool dir_lookup (const struct dir *, const char *name, disk_sector_t *);
 bool dir_add (struct dir *, const char *name, disk_sector_t);
 bool dir_remove (struct dir *, const char *name);
 void dir_list (const struct dir *);
-void dir_dump (const struct dir *);
 
 #endif /* filesys/directory.h */