changed name of inode manager
This commit is contained in:
parent
6edece492c
commit
634180c3ce
@ -1,9 +1,9 @@
|
|||||||
#ifndef FS_HPP
|
#ifndef FS_HPP
|
||||||
#define FS_HPP
|
#define FS_HPP
|
||||||
|
|
||||||
#include "fs/datablock_allocator.hpp"
|
#include "fs/datablock_manager.hpp"
|
||||||
#include "fs/fs_data_types.hpp"
|
#include "fs/fs_data_types.hpp"
|
||||||
#include "fs/inode_allocator.hpp"
|
#include "fs/inode_manager.hpp"
|
||||||
#include "fs_constants.hpp"
|
#include "fs_constants.hpp"
|
||||||
#include "rawdisk.hpp"
|
#include "rawdisk.hpp"
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ public:
|
|||||||
// should probably be private but is not for testing
|
// should probably be private but is not for testing
|
||||||
RawDisk *disk;
|
RawDisk *disk;
|
||||||
SuperBlock_Data superblock;
|
SuperBlock_Data superblock;
|
||||||
INode_Allocator *inode_allocator;
|
INode_Manager *inode_manager;
|
||||||
DataBlock_Allocator *datablock_allocator;
|
DataBlock_Manager *datablock_manager;
|
||||||
|
|
||||||
int load_superblock();
|
int load_superblock();
|
||||||
int save_superblock();
|
int save_superblock();
|
||||||
@ -29,9 +29,6 @@ public:
|
|||||||
int save_free_list_head(u_int64_t new_free_list_head);
|
int save_free_list_head(u_int64_t new_free_list_head);
|
||||||
int save_inode_list_head(u_int64_t new_inode_list_head);
|
int save_inode_list_head(u_int64_t new_inode_list_head);
|
||||||
|
|
||||||
int load_inode(INode_Data *inode_data);
|
|
||||||
int save_inode(INode_Data *inode_data);
|
|
||||||
|
|
||||||
int allocate_indirect(u_int64_t *storage, int n);
|
int allocate_indirect(u_int64_t *storage, int n);
|
||||||
int deallocate_indirect(u_int64_t *storage, int n);
|
int deallocate_indirect(u_int64_t *storage, int n);
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#ifndef DATABLOCK_ALLOCATOR_HPP
|
#ifndef DATABLOCK_MANAGER_HPP
|
||||||
#define DATABLOCK_ALLOCATOR_HPP
|
#define DATABLOCK_MANAGER_HPP
|
||||||
|
|
||||||
#include "fs_constants.hpp"
|
#include "fs_constants.hpp"
|
||||||
|
|
||||||
class Fs;
|
class Fs;
|
||||||
|
|
||||||
class DataBlock_Allocator {
|
class DataBlock_Manager {
|
||||||
public:
|
public:
|
||||||
DataBlock_Allocator(Fs *fs, u_int64_t block_segment_start,
|
DataBlock_Manager(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end);
|
u_int64_t block_segment_end);
|
||||||
|
|
||||||
virtual int new_datablock(u_int64_t *block_num) = 0;
|
virtual int new_datablock(u_int64_t *block_num) = 0;
|
||||||
@ -20,11 +20,11 @@ protected:
|
|||||||
u_int64_t block_segment_start, block_segment_end;
|
u_int64_t block_segment_start, block_segment_end;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DataBlock_Allocator_Bitmap : public DataBlock_Allocator {
|
class DataBlock_Manager_Bitmap : public DataBlock_Manager {
|
||||||
public:
|
public:
|
||||||
DataBlock_Allocator_Bitmap(Fs *fs, u_int64_t block_segment_start,
|
DataBlock_Manager_Bitmap(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end)
|
u_int64_t block_segment_end)
|
||||||
: DataBlock_Allocator(fs, block_segment_start, block_segment_end) {}
|
: DataBlock_Manager(fs, block_segment_start, block_segment_end) {}
|
||||||
|
|
||||||
int new_datablock(u_int64_t *block_num) override;
|
int new_datablock(u_int64_t *block_num) override;
|
||||||
int free_datablock(u_int64_t block_num) override;
|
int free_datablock(u_int64_t block_num) override;
|
@ -1,16 +1,16 @@
|
|||||||
#ifndef INODE_ALLOCATOR_HPP
|
#ifndef INODE_MANAGER_HPP
|
||||||
#define INODE_ALLOCATOR_HPP
|
#define INODE_MANAGER_HPP
|
||||||
|
|
||||||
#include "fs_constants.hpp"
|
#include "fs_constants.hpp"
|
||||||
#include "fs_data_types.hpp"
|
#include "fs_data_types.hpp"
|
||||||
|
|
||||||
class Fs;
|
class Fs;
|
||||||
|
|
||||||
class INode_Allocator {
|
class INode_Manager {
|
||||||
public:
|
public:
|
||||||
const int INODES_PER_BLOCK = IO_BLOCK_SIZE / INODE_SIZE;
|
const int INODES_PER_BLOCK = IO_BLOCK_SIZE / INODE_SIZE;
|
||||||
|
|
||||||
INode_Allocator(Fs *fs, u_int64_t block_segment_start,
|
INode_Manager(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end);
|
u_int64_t block_segment_end);
|
||||||
|
|
||||||
virtual int new_inode(u_int64_t uid, u_int64_t gid, u_int64_t permissions,
|
virtual int new_inode(u_int64_t uid, u_int64_t gid, u_int64_t permissions,
|
||||||
@ -22,17 +22,20 @@ public:
|
|||||||
u_int64_t get_block_num(u_int64_t inode_data);
|
u_int64_t get_block_num(u_int64_t inode_data);
|
||||||
u_int64_t get_block_offset(u_int64_t inode_data);
|
u_int64_t get_block_offset(u_int64_t inode_data);
|
||||||
|
|
||||||
|
int load_inode(INode_Data *inode_data);
|
||||||
|
int save_inode(INode_Data *inode_data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Fs *fs;
|
Fs *fs;
|
||||||
u_int64_t block_segment_start, block_segment_end;
|
u_int64_t block_segment_start, block_segment_end;
|
||||||
u_int64_t max_num_inodes;
|
u_int64_t max_num_inodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
class INode_Allocator_Freelist : public INode_Allocator {
|
class INode_Manager_Freelist : public INode_Manager {
|
||||||
public:
|
public:
|
||||||
INode_Allocator_Freelist(Fs *fs, u_int64_t block_segment_start,
|
INode_Manager_Freelist(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end)
|
u_int64_t block_segment_end)
|
||||||
: INode_Allocator(fs, block_segment_start, block_segment_end) {}
|
: INode_Manager(fs, block_segment_start, block_segment_end) {}
|
||||||
|
|
||||||
int new_inode(u_int64_t uid, u_int64_t gid, u_int64_t permissions,
|
int new_inode(u_int64_t uid, u_int64_t gid, u_int64_t permissions,
|
||||||
INode_Data *inode_data) override;
|
INode_Data *inode_data) override;
|
@ -1,6 +1,6 @@
|
|||||||
#include "fs.hpp"
|
#include "fs.hpp"
|
||||||
|
|
||||||
DataBlock_Allocator::DataBlock_Allocator(Fs *fs, u_int64_t block_segment_start,
|
DataBlock_Manager::DataBlock_Manager(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end)
|
u_int64_t block_segment_end)
|
||||||
: fs(fs), block_segment_start(block_segment_start),
|
: fs(fs), block_segment_start(block_segment_start),
|
||||||
block_segment_end(block_segment_end) {}
|
block_segment_end(block_segment_end) {}
|
||||||
@ -45,7 +45,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int DataBlock_Allocator_Bitmap::new_datablock(u_int64_t *block_num) {
|
int DataBlock_Manager_Bitmap::new_datablock(u_int64_t *block_num) {
|
||||||
int err;
|
int err;
|
||||||
BitmapBlock_Data bitmap = BitmapBlock_Data(DATABLOCKS_PER_BITMAP_BLOCK);
|
BitmapBlock_Data bitmap = BitmapBlock_Data(DATABLOCKS_PER_BITMAP_BLOCK);
|
||||||
u_int64_t bitmap_block_num = fs->superblock.free_list_head;
|
u_int64_t bitmap_block_num = fs->superblock.free_list_head;
|
||||||
@ -83,7 +83,7 @@ int DataBlock_Allocator_Bitmap::new_datablock(u_int64_t *block_num) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataBlock_Allocator_Bitmap::free_datablock(u_int64_t block_num) {
|
int DataBlock_Manager_Bitmap::free_datablock(u_int64_t block_num) {
|
||||||
int err;
|
int err;
|
||||||
BitmapBlock_Data bitmap = BitmapBlock_Data(DATABLOCKS_PER_BITMAP_BLOCK);
|
BitmapBlock_Data bitmap = BitmapBlock_Data(DATABLOCKS_PER_BITMAP_BLOCK);
|
||||||
const u_int64_t bitmap_region_size = DATABLOCKS_PER_BITMAP_BLOCK + 1;
|
const u_int64_t bitmap_region_size = DATABLOCKS_PER_BITMAP_BLOCK + 1;
|
||||||
@ -117,7 +117,7 @@ int DataBlock_Allocator_Bitmap::free_datablock(u_int64_t block_num) {
|
|||||||
// potentially like 256 times slower throughput
|
// potentially like 256 times slower throughput
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataBlock_Allocator_Bitmap::format() {
|
int DataBlock_Manager_Bitmap::format() {
|
||||||
const u_int64_t bitmap_region_size = DATABLOCKS_PER_BITMAP_BLOCK + 1;
|
const u_int64_t bitmap_region_size = DATABLOCKS_PER_BITMAP_BLOCK + 1;
|
||||||
char buf[IO_BLOCK_SIZE] = {0};
|
char buf[IO_BLOCK_SIZE] = {0};
|
||||||
int err;
|
int err;
|
||||||
|
@ -2,23 +2,23 @@
|
|||||||
|
|
||||||
Fs::Fs(RawDisk *disk) : disk(disk) {
|
Fs::Fs(RawDisk *disk) : disk(disk) {
|
||||||
superblock = SuperBlock_Data();
|
superblock = SuperBlock_Data();
|
||||||
inode_allocator = new INode_Allocator_Freelist(this, 1, 1 + NUM_INODE_BLOCKS);
|
inode_manager = new INode_Manager_Freelist(this, 1, 1 + NUM_INODE_BLOCKS);
|
||||||
datablock_allocator =
|
datablock_manager =
|
||||||
new DataBlock_Allocator_Bitmap(this, 1 + NUM_INODE_BLOCKS, NUM_BLOCKS);
|
new DataBlock_Manager_Bitmap(this, 1 + NUM_INODE_BLOCKS, NUM_BLOCKS);
|
||||||
};
|
};
|
||||||
|
|
||||||
Fs::~Fs() {
|
Fs::~Fs() {
|
||||||
delete inode_allocator;
|
delete inode_manager;
|
||||||
delete datablock_allocator;
|
delete datablock_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
int Fs::format() {
|
int Fs::format() {
|
||||||
int err;
|
int err;
|
||||||
if ((err = save_superblock()) < 0)
|
if ((err = save_superblock()) < 0)
|
||||||
return err;
|
return err;
|
||||||
if ((err = inode_allocator->format()) < 0)
|
if ((err = inode_manager->format()) < 0)
|
||||||
return err;
|
return err;
|
||||||
if ((err = datablock_allocator->format()) < 0)
|
if ((err = datablock_manager->format()) < 0)
|
||||||
return err;
|
return err;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -65,42 +65,4 @@ int Fs::save_inode_list_head(u_int64_t new_inode_list_head) {
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
int Fs::load_inode(INode_Data *inode_data) {
|
|
||||||
char buf[IO_BLOCK_SIZE];
|
|
||||||
int err;
|
|
||||||
|
|
||||||
u_int64_t block_num = inode_allocator->get_block_num(inode_data->inode_num);
|
|
||||||
if (block_num == 0)
|
|
||||||
return -1;
|
|
||||||
u_int64_t block_offset =
|
|
||||||
inode_allocator->get_block_offset(inode_data->inode_num);
|
|
||||||
|
|
||||||
if ((err = disk->read_block(block_num, buf)) < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
inode_data->deserialize(&buf[block_offset]);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int Fs::save_inode(INode_Data *inode_data) {
|
|
||||||
char buf[IO_BLOCK_SIZE];
|
|
||||||
int err;
|
|
||||||
|
|
||||||
u_int64_t block_num = inode_allocator->get_block_num(inode_data->inode_num);
|
|
||||||
if (block_num == 0)
|
|
||||||
return -1;
|
|
||||||
u_int64_t block_offset =
|
|
||||||
inode_allocator->get_block_offset(inode_data->inode_num);
|
|
||||||
|
|
||||||
if ((err = disk->read_block(block_num, buf)) < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
inode_data->serialize(&buf[block_offset]);
|
|
||||||
|
|
||||||
if ((err = disk->write_block(block_num, buf)) < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ int Fs::allocate_datablock(INode_Data *inode_data) {
|
|||||||
|
|
||||||
for (size_t i = 0; i < NUMBER_OF_DIRECT_BLOCKS; ++i)
|
for (size_t i = 0; i < NUMBER_OF_DIRECT_BLOCKS; ++i)
|
||||||
if (inode_data->direct_blocks[i] == 0) {
|
if (inode_data->direct_blocks[i] == 0) {
|
||||||
if ((result = datablock_allocator->new_datablock(
|
if ((result = datablock_manager->new_datablock(
|
||||||
&(inode_data->direct_blocks[i]))) < 0)
|
&(inode_data->direct_blocks[i]))) < 0)
|
||||||
return result;
|
return result;
|
||||||
return 0;
|
return 0;
|
||||||
@ -33,7 +33,7 @@ int Fs::allocate_indirect(u_int64_t *storage, int n) {
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
if ((*storage) == 0) {
|
if ((*storage) == 0) {
|
||||||
if ((result = datablock_allocator->new_datablock(storage)) < 0)
|
if ((result = datablock_manager->new_datablock(storage)) < 0)
|
||||||
return result;
|
return result;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -80,7 +80,7 @@ int Fs::deallocate_datablock(INode_Data *inode_data) {
|
|||||||
|
|
||||||
for (size_t i = NUMBER_OF_DIRECT_BLOCKS - 1; i >= 0; --i)
|
for (size_t i = NUMBER_OF_DIRECT_BLOCKS - 1; i >= 0; --i)
|
||||||
if (inode_data->direct_blocks[i] != 0) {
|
if (inode_data->direct_blocks[i] != 0) {
|
||||||
if ((result = datablock_allocator->free_datablock(
|
if ((result = datablock_manager->free_datablock(
|
||||||
inode_data->direct_blocks[i])) < 0)
|
inode_data->direct_blocks[i])) < 0)
|
||||||
return result;
|
return result;
|
||||||
inode_data->direct_blocks[i] = 0;
|
inode_data->direct_blocks[i] = 0;
|
||||||
@ -98,7 +98,7 @@ int Fs::deallocate_indirect(u_int64_t *storage, int n) {
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
if ((result = datablock_allocator->free_datablock(*storage)) < 0)
|
if ((result = datablock_manager->free_datablock(*storage)) < 0)
|
||||||
return result;
|
return result;
|
||||||
(*storage) = 0;
|
(*storage) = 0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -117,7 +117,7 @@ int Fs::deallocate_indirect(u_int64_t *storage, int n) {
|
|||||||
return result;
|
return result;
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
if (i == 0 && temp == 0) {
|
if (i == 0 && temp == 0) {
|
||||||
if ((result = datablock_allocator->free_datablock(*storage)) < 0)
|
if ((result = datablock_manager->free_datablock(*storage)) < 0)
|
||||||
return result;
|
return result;
|
||||||
(*storage) = 0;
|
(*storage) = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,23 +1,59 @@
|
|||||||
#include "fs.hpp"
|
#include "fs.hpp"
|
||||||
|
|
||||||
INode_Allocator::INode_Allocator(Fs *fs, u_int64_t block_segment_start,
|
INode_Manager::INode_Manager(Fs *fs, u_int64_t block_segment_start,
|
||||||
u_int64_t block_segment_end)
|
u_int64_t block_segment_end)
|
||||||
: fs(fs), block_segment_start(block_segment_start),
|
: fs(fs), block_segment_start(block_segment_start),
|
||||||
block_segment_end(block_segment_end) {
|
block_segment_end(block_segment_end) {
|
||||||
max_num_inodes = (block_segment_end - block_segment_start) * INODES_PER_BLOCK;
|
max_num_inodes = (block_segment_end - block_segment_start) * INODES_PER_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int64_t INode_Allocator::get_block_num(u_int64_t inode_num) {
|
u_int64_t INode_Manager::get_block_num(u_int64_t inode_num) {
|
||||||
u_int64_t block_num = block_segment_start + (inode_num / INODES_PER_BLOCK);
|
u_int64_t block_num = block_segment_start + (inode_num / INODES_PER_BLOCK);
|
||||||
if (block_num >= block_segment_end)
|
if (block_num >= block_segment_end)
|
||||||
return 0;
|
return 0;
|
||||||
return block_num;
|
return block_num;
|
||||||
}
|
}
|
||||||
u_int64_t INode_Allocator::get_block_offset(u_int64_t inode_num) {
|
u_int64_t INode_Manager::get_block_offset(u_int64_t inode_num) {
|
||||||
return (inode_num % INODES_PER_BLOCK) * INODE_SIZE;
|
return (inode_num % INODES_PER_BLOCK) * INODE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int INode_Allocator_Freelist::new_inode(u_int64_t uid, u_int64_t gid,
|
int INode_Manager::load_inode(INode_Data *inode_data) {
|
||||||
|
char buf[IO_BLOCK_SIZE];
|
||||||
|
int err;
|
||||||
|
|
||||||
|
u_int64_t block_num = get_block_num(inode_data->inode_num);
|
||||||
|
if (block_num == 0)
|
||||||
|
return -1;
|
||||||
|
u_int64_t block_offset = get_block_offset(inode_data->inode_num);
|
||||||
|
|
||||||
|
if ((err = fs->disk->read_block(block_num, buf)) < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
inode_data->deserialize(&buf[block_offset]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int INode_Manager::save_inode(INode_Data *inode_data) {
|
||||||
|
char buf[IO_BLOCK_SIZE];
|
||||||
|
int err;
|
||||||
|
|
||||||
|
u_int64_t block_num = get_block_num(inode_data->inode_num);
|
||||||
|
if (block_num == 0)
|
||||||
|
return -1;
|
||||||
|
u_int64_t block_offset = get_block_offset(inode_data->inode_num);
|
||||||
|
|
||||||
|
if ((err = fs->disk->read_block(block_num, buf)) < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
inode_data->serialize(&buf[block_offset]);
|
||||||
|
|
||||||
|
if ((err = fs->disk->write_block(block_num, buf)) < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int INode_Manager_Freelist::new_inode(u_int64_t uid, u_int64_t gid,
|
||||||
u_int64_t permissions,
|
u_int64_t permissions,
|
||||||
INode_Data *inode_data) {
|
INode_Data *inode_data) {
|
||||||
char buf[IO_BLOCK_SIZE];
|
char buf[IO_BLOCK_SIZE];
|
||||||
@ -47,14 +83,14 @@ int INode_Allocator_Freelist::new_inode(u_int64_t uid, u_int64_t gid,
|
|||||||
inode_data->metadata.permissions = permissions;
|
inode_data->metadata.permissions = permissions;
|
||||||
|
|
||||||
// It is debatable if this function should do this:
|
// It is debatable if this function should do this:
|
||||||
if ((err = fs->save_inode(inode_data)) < 0) {
|
if ((err = save_inode(inode_data)) < 0) {
|
||||||
inode_data->inode_num = 0xFFFFFFFFFFFFFFFF;
|
inode_data->inode_num = 0xFFFFFFFFFFFFFFFF;
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int INode_Allocator_Freelist::free_inode(INode_Data *inode_data) {
|
int INode_Manager_Freelist::free_inode(INode_Data *inode_data) {
|
||||||
char buf[IO_BLOCK_SIZE];
|
char buf[IO_BLOCK_SIZE];
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -78,7 +114,7 @@ int INode_Allocator_Freelist::free_inode(INode_Data *inode_data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int INode_Allocator_Freelist::format() {
|
int INode_Manager_Freelist::format() {
|
||||||
char buf[IO_BLOCK_SIZE];
|
char buf[IO_BLOCK_SIZE];
|
||||||
int err;
|
int err;
|
||||||
u_int64_t next_inode_num = 1;
|
u_int64_t next_inode_num = 1;
|
||||||
@ -92,3 +128,5 @@ int INode_Allocator_Freelist::format() {
|
|||||||
return err;
|
return err;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ int main() {
|
|||||||
disk->print_block(0);
|
disk->print_block(0);
|
||||||
disk->print_block(1);
|
disk->print_block(1);
|
||||||
INode_Data inode_data = INode_Data();
|
INode_Data inode_data = INode_Data();
|
||||||
fs->inode_allocator->new_inode(1, 2, 3, &inode_data);
|
fs->inode_manager->new_inode(1, 2, 3, &inode_data);
|
||||||
int err;
|
int err;
|
||||||
for (int i = 0; i < 56 + 512 + 4; ++i)
|
for (int i = 0; i < 56 + 512 + 4; ++i)
|
||||||
err = fs->allocate_datablock(&inode_data);
|
err = fs->allocate_datablock(&inode_data);
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
printf("%d\n", err = fs->deallocate_datablock(&inode_data));
|
printf("%d\n", err = fs->deallocate_datablock(&inode_data));
|
||||||
|
|
||||||
fs->save_inode(&inode_data);
|
fs->inode_manager->save_inode(&inode_data);
|
||||||
|
|
||||||
disk->print_block(0);
|
disk->print_block(0);
|
||||||
disk->print_block(1);
|
disk->print_block(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user