Skip to content

Instantly share code, notes, and snippets.

@GiantRobato
Created January 30, 2020 05:09
Show Gist options
  • Select an option

  • Save GiantRobato/2af13b461ea3ecce6ae1abd58f64927a to your computer and use it in GitHub Desktop.

Select an option

Save GiantRobato/2af13b461ea3ecce6ae1abd58f64927a to your computer and use it in GitHub Desktop.
APUE File System Create Directory
digraph G {
CG [
shape=plaintext
label=<
<table border='0' cellborder='1' cellspacing='0'>
<tr>
<td>CG</td>
<td>...</td>
<td port='one'>i-nodes</td>
<td>...</td>
<td port='two'>dir block</td>
<td>...</td>
<td port='three'>dir block</td>
<td>...</td>
</tr>
</table>
>];
INodes [
shape=plaintext
label=<
<table border='0' cellborder='1' cellspacing='0'>
<tr>
<td>i-node array</td>
<td>i-node 0</td>
<td>...</td>
<td port="one">i-node 1267</td>
<td>...</td>
<td port="two">i-node 2549</td>
<td>...</td>
</tr>
</table>
>];
NewDirBlock [
shape=plaintext
label=<
<table border='0' cellborder='1' cellspacing='0'>
<tr>
<td port="one">2549</td>
<td>.</td>
</tr>
<tr>
<td port="two">1267</td>
<td>..</td>
</tr>
</table>
>];
DirBlock [
shape=plaintext
label=<
<table border='0' cellborder='1' cellspacing='0'>
<tr>
<td port="one">1267</td>
<td>.</td>
</tr>
<tr>
<td port="two">i-node number</td>
<td>..</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td port="three">2549</td>
<td>test dir</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
>];
CG:one -> INodes;
CG:one:s -> INodes;
CG:two:s -> NewDirBlock:n;
CG:three -> DirBlock;
INodes:one -> CG:three;
INodes:two -> CG:two;
INodes -> DirBlock [style=invis];
INodes -> NewDirBlock [style=invis];
CG -> DirBlock [style=invis];
DirBlock:one -> INodes:one
DirBlock:three -> INodes:two
NewDirBlock:one -> INodes:two:n;
NewDirBlock:two -> INodes:one;
{rank=same; INodes; NewDirBlock}
}
@GiantRobato

Copy link
Copy Markdown
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment