-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfsFreeSpace.h
More file actions
25 lines (22 loc) · 833 Bytes
/
fsFreeSpace.h
File metadata and controls
25 lines (22 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef FS_FREE_SPACE_H
#define FS_FREE_SPACE_H
typedef struct extent
{
int location; // Beginning of Extent
int count; // Length of Extent
} extent;
int initFreeSpace (int totalBlocks);
int readFreeSpace (int blockNumber);
int exitFreeSpace ();
int useFreeSpace (extent* freeSpace);
int returnFreeSpace (extent* usedSpace);
extent* findFreeSpace (int numberOfBlocks, int minimumSize);
int writeExtents (void* buffer, extent* extents);
int copyExtents (extent* source, extent* destination);
int trimExtents (extent* extents, int lastBlock);
extent* appendExtents (extent* oldExtents, extent* newExtents);
extent* createSecondaryExtents (extent* extents, int lastIndex);
extent* createTertiaryExtents (extent* extents, int lastIndex);
int getBlock (extent* extents, int index);
int getLastBlock (extent* extents);
#endif