-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileSystem.h
More file actions
78 lines (65 loc) · 1.37 KB
/
FileSystem.h
File metadata and controls
78 lines (65 loc) · 1.37 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Project Untitled
*/
#ifndef _FILESYSTEM_H
#define _FILESYSTEM_H
#include<iostream>
#include "SuperBlock.h"
#include "Inode.h"
using namespace::std;
class FileSystem {
public:
static const int SUPER_BLOCK_SECTOR_NUMBER = 0;
static const int ROOTINO = 0;
static const int INODE_NUMBER_PER_SECTOR = 8;
static const int INODE_ZONE_START_SECTOR = 2;
static const int INODE_ZONE_SIZE = 1024 - 2;
static const int DATA_ZONE_START_SECTOR = 1024;
static const int DATA_ZONE_END_SECTOR = 18000 - 1;
static const int DATA_ZONE_SIZE = 18000 - DATA_ZONE_START_SECTOR;
SuperBlock* f_SuperBlock;
/**
* @comment 初始化
*
*/
void Initialize();
/*
*@comment 加载SuperBlock到内存当中
*
*/
void LoadSuperBlock();
/*
* @comment 返回当前的SuperBlock
*
*/
SuperBlock* GetFS();
/*
* @comment 更新SuperBlock到硬盘当中
*
*/
void Update();
/*
* @comment 分配Inode结点
*
*/
Inode* IAlloc();
/**
* @param number
* @comment 释放Inode结点
*/
void IFree(int number);
/*
* @comment 分配DIskBlock
*
*/
int Alloc();
/**
* @param blkno
* @comment 释放DiskBlock
*/
void Free(int blkno);
public:
FileSystem();
~FileSystem();
};
#endif //_FILESYSTEM_H