|
CS318 - Pintos
Pintos source browser for JHU CS318 course
|


Go to the source code of this file.
Functions | |
| void | free_map_init (void) |
| Initializes the free map. More... | |
| void | free_map_read (void) |
| void | free_map_create (void) |
| Creates a new free map file on disk and writes the free map to it. More... | |
| void | free_map_open (void) |
| Opens the free map file and reads it from disk. More... | |
| void | free_map_close (void) |
| Writes the free map to disk and closes the free map file. More... | |
| bool | free_map_allocate (size_t, block_sector_t *) |
| Allocates CNT consecutive sectors from the free map and stores the first into *SECTORP. More... | |
| void | free_map_release (block_sector_t, size_t) |
| filesys/free-map.h More... | |
| bool free_map_allocate | ( | size_t | cnt, |
| block_sector_t * | sectorp | ||
| ) |
Allocates CNT consecutive sectors from the free map and stores the first into *SECTORP.
Returns true if successful, false if not enough consecutive sectors were available or if the free_map file could not be written.
Definition at line 28 of file free-map.c.
References BITMAP_ERROR, bitmap_scan_and_flip(), bitmap_set_multiple(), free_map, free_map_file, and NULL.
Referenced by filesys_create(), and inode_create().


| void free_map_close | ( | void | ) |
Writes the free map to disk and closes the free map file.
Definition at line 65 of file free-map.c.
References file_close(), and free_map_file.
Referenced by do_format(), and filesys_done().


| void free_map_create | ( | void | ) |
Creates a new free map file on disk and writes the free map to it.
Definition at line 73 of file free-map.c.
References file_open(), free_map, free_map_file, FREE_MAP_SECTOR, inode_create(), inode_open(), NULL, and PANIC.
Referenced by do_format().


| void free_map_init | ( | void | ) |
Initializes the free map.
Definition at line 13 of file free-map.c.
References bitmap_create(), bitmap_mark(), block_size(), free_map, FREE_MAP_SECTOR, fs_device, NULL, PANIC, and ROOT_DIR_SECTOR.
Referenced by filesys_init().


| void free_map_open | ( | void | ) |
Opens the free map file and reads it from disk.
Definition at line 54 of file free-map.c.
References file_open(), free_map, free_map_file, FREE_MAP_SECTOR, inode_open(), NULL, and PANIC.
Referenced by filesys_init().


| void free_map_read | ( | void | ) |
| void free_map_release | ( | block_sector_t | sector, |
| size_t | cnt | ||
| ) |
Definition at line 45 of file free-map.c.
References ASSERT, bitmap_all(), bitmap_set_multiple(), free_map, and free_map_file.
Referenced by filesys_create(), and inode_close().


1.8.16