Created
May 27, 2015 03:56
-
-
Save aerodame/dcb1175be50086872c83 to your computer and use it in GitHub Desktop.
Inode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Inode { | |
private final static int iNodeSize = 32; // fix to 32 bytes | |
private final static int directSize = 11; // # direct pointers | |
public int length; // file size in bytes | |
public short count; // # file-table entries pointing to this | |
public short flag; // 0 = unused, 1 = used, ... | |
public short direct[] = new short[directSize]; // direct pointers | |
public short indirect; // a indirect pointer | |
Inode( ) { // a default constructor | |
length = 0; | |
count = 0; | |
flag = 1; | |
for ( int i = 0; i < directSize; i++ ) | |
direct[i] = -1; | |
indirect = -1; | |
} | |
Inode( short iNumber ) { // retrieving inode from disk | |
// design it by yourself. | |
} | |
int toDisk( short iNumber ) { // save to disk as the i-th inode | |
// design it by yourself. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment