PKUOS - Pintos
Pintos source browser for PKU Operating System course
free-map.h
Go to the documentation of this file.
1#ifndef FILESYS_FREE_MAP_H
2#define FILESYS_FREE_MAP_H
3
4#include <stdbool.h>
5#include <stddef.h>
6#include "devices/block.h"
7
8void free_map_init (void);
9void free_map_read (void);
10void free_map_create (void);
11void free_map_open (void);
12void free_map_close (void);
13
14bool free_map_allocate (size_t, block_sector_t *);
15void free_map_release (block_sector_t, size_t);
16
17#endif /**< filesys/free-map.h */
uint32_t block_sector_t
Index of a block device sector.
Definition: block.h:15
void free_map_release(block_sector_t, size_t)
filesys/free-map.h
Definition: free-map.c:45
void free_map_init(void)
Initializes the free map.
Definition: free-map.c:13
bool free_map_allocate(size_t, block_sector_t *)
Allocates CNT consecutive sectors from the free map and stores the first into *SECTORP.
Definition: free-map.c:28
void free_map_open(void)
Opens the free map file and reads it from disk.
Definition: free-map.c:54
void free_map_create(void)
Creates a new free map file on disk and writes the free map to it.
Definition: free-map.c:73
void free_map_close(void)
Writes the free map to disk and closes the free map file.
Definition: free-map.c:65
void free_map_read(void)