PNFS
Introduction
This is a filesystem that is designed and implemented for a school assignment. The structure is kinda based on ext2 and runs on a “virtual” HDD. That have 250 blocks, where each block is 512 bytes.
The name PNFS stands for PowerNexFileSystem. But I haven’t decided if I want to use this in PowerNex.
License
Mozilla Public License, version 2.0 - See LICENSE or here.
Design
Blocks
- Block 0
- Header
- Block 1-16
- Node x8 // Total of 128 Nodes
- Block 17
- Root DirBlock
- DirEntries x8
Class diagram
Tree
digraph tree {
graph [
rankdir = LR,
ranksep = 1
];
node [
fontsize = "16"
shape = "ellipse"
];
edge [
];
"start" [
style=filled,
fillcolor=green,
label="Filesystem root"
];
"start" -> "root";
"root" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 1|type = dir"
];
"root" -> "root_direntry":d [
shape="record",
label = "directoryEntries()"
];
"root_direntry" [
shape="record",
style=filled,
fillcolor=pink,
label="<d>***fs_direntry[]**|<d0> .(1) | <d1> ..(1) | <d2> bin(2) | <d3> data(3)"
];
"root_direntry":d0 -> "root" [
label="getNode(1)"
];
"root_direntry":d1 -> "root" [
label="getNode(1)"
];
"root_direntry":d2 -> "bin" [
label="getNode(2)"
];
"root_direntry":d3 -> "data" [
label="getNode(3)"
];
"bin" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 2|type = dir"
];
"bin" -> "bin_direntry":d [
shape="record",
label = "directoryEntries()"
];
"bin_direntry" [
shape="record",
style=filled,
fillcolor=pink,
label="<d>***fs_direntry[]***| <d0> .(1) | <d1> ..(1) | <d2> bin(2) | <d3> data(3)"
];
"bin_direntry" [
shape="record",
label="<d>***fs_direntry[]***| <d0> .(2) | <d1> ..(1) | <d2> helloworld(4) | <d3> testprogram(5)"
];
"bin_direntry":d0 -> "bin" [
label="getNode(2)"
];
"bin_direntry":d1 -> "root" [
label="getNode(1)"
];
"bin_direntry":d2 -> "helloworld" [
label="getNode(4)"
];
"bin_direntry":d3 -> "testprogram" [
label="getNode(5)"
];
"data" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 3|type = dir"
];
"data" -> "data_direntry":d [
shape="record",
label = "directoryEntries()"
];
"data_direntry" [
shape="record",
style=filled,
fillcolor=pink,
label="<d>***fs_direntry[]***| <d0> .(3) | <d1> ..(1) | <d2> image.bmp(6) | <d3> sound.ogg(7)"
];
"data_direntry":d0 -> "data" [
label="getNode(3)"
];
"data_direntry":d1 -> "root" [
label="getNode(1)"
];
"data_direntry":d2 -> "image.bmp" [
label="getNode(6)"
];
"data_direntry":d3 -> "sound.ogg" [
label="getNode(7)"
];
"helloworld" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 4|type = file"
];
"testprogram" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 5|type = file"
];
"image.bmp" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 6|type = file"
];
"sound.ogg" [
shape="record",
style=filled,
fillcolor=cyan,
label="***fs_node***|id = 7|type = file"
];
}