操作系统实验内容,仅供学习交流,欢迎大神指教
测试数据:
Indexes.h
/*
* indexes.h
*
* Created on: 2019年12月19日
* Author: zyli
*/
#ifndef INDEXES_H_
#define INDEXES_H_
#define BLOCK_SIZE 32
#define BLOCK_NUM_SIZE 2
int n=16;
int nI=10;
int max_blocksAmount =4669; //14+3*n+2*n*n+n*n*n;
int maxstroe=140096;
int bytes_Block[140096];
int bytes_Level[140096];
int bytes_d_level1[140096];
int bytes_d_level2[140096];
int bytes_d_level3[140096];
int bytes_d_level4[140096];
int currentbyte;
struct block3
{
int num_of_indexblock;
int contentBlocks[16];
};
struct block2
{
int num_of_indexblock;
struct block3 content_indexblocks[16];
int contentBlocks[16];
};
struct block1
{
int num_of_indexblock;
struct block2 content_indexblocks[16];
int contentBlocks[16];
};//indexblocks[291];//[3+2*n+n*n]; //1+1+n+1+n+n*n
struct fileblock
{
int num_of_fileblock;
int I_nodeContentBlocks[10];
struct block1 firstP;
struct block1 secondP;
struct block1 thirdP;
// int I_nodeMax;
// int firstPMax;
// int secondMax;
// int thirdMax;
}FileBlock;
void init_file()
{
for(int i=0;i<max_blocksAmount;i++)
{
bytes_Block[i]=0;
}
for(int i=0;i<140096;i++)
{
bytes_d_level1[i