rossi.fstools.fs.reiserfs
Class ReiserSuperBlock
java.lang.Object
rossi.fstools.fs.reiserfs.ReiserSuperBlock
- All Implemented Interfaces:
- DiskStructure, SuperBlock
- public class ReiserSuperBlock
- extends java.lang.Object
- implements SuperBlock
Representation of ReiserFS superblock.
On disk the superblock looks like this:
31 24 16 8 0
--------------------------------------
0000 | Block Count |
--------------------------------------
0004 | Free Blocks |
--------------------------------------
0008 | Root Block |
--------------------------------------
000C | Journal Block |
--------------------------------------
0010 | Journal Device |
--------------------------------------
0014 | Orig Journal Size |
--------------------------------------
0018 | Journal Trans Max |
--------------------------------------
001C | Journal Block Count |
--------------------------------------
0020 | Journal Max Batch |
--------------------------------------
0024 | Journal Commit Age |
--------------------------------------
0028 | Journal Trans Age |
--------------------------------------
002C | Block Size | Old Max Size |
--------------------------------------
0030 | Curr Size | State |
--------------------------------------
0034 | Magic |
--------------------------------------
0038 | Magic (cont) |
--------------------------------------
003C | Magic (cont) |
--------------------------------------
0040 | Hash Func | For V1, this is omitted
--------------------------------------
0044 | Tree Height | Bitmap Blocks |
--------------------------------------
0048 | Version | Reserved | Remaining fields omitted in V1
--------------------------------------
004C | Inode Gen |
--------------------------------------
0050 | Flags |
--------------------------------------
0054 | Filesystem Unique Id |
--------------------------------------
0058 | Filesystem Unique Id |
--------------------------------------
005C | Filesystem Unique Id |
--------------------------------------
0060` | Filesystem Unique Id |
--------------------------------------
0064 | Volume Label |
--------------------------------------
0068 | Volume Label |
--------------------------------------
006C | Volume Label |
--------------------------------------
0070 | Volume Label |
--------------------------------------
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
blockCount
protected long blockCount
freeBlocks
protected long freeBlocks
rootBlock
protected long rootBlock
journalBlock
protected long journalBlock
journalDev
protected long journalDev
origJournalSize
protected long origJournalSize
journalTransMax
protected long journalTransMax
journalBlockCount
protected long journalBlockCount
journalMaxBatch
protected long journalMaxBatch
journalCommitAge
protected long journalCommitAge
journalTransAge
protected long journalTransAge
blockSize
protected int blockSize
oldMaxSize
protected int oldMaxSize
currSize
protected int currSize
state
protected int state
magic
protected byte[] magic
hashFunc
protected long hashFunc
treeHeight
protected int treeHeight
bitmapBlocks
protected int bitmapBlocks
version
protected int version
reserved
protected int reserved
inodeGen
protected long inodeGen
flags
protected long flags
uniqueID
protected byte[] uniqueID
label
protected byte[] label
ReiserSuperBlock
public ReiserSuperBlock()
getDataSize
public int getDataSize()
- Description copied from interface:
DiskStructure
- Get the size in bytes of the structure. For variable length sturctures
this may represent the minimum length rather than the actual length.
- Specified by:
getDataSize in interface DiskStructure
- Returns:
- the size of the structure.
getBlockCount
public long getBlockCount()
setBlockCount
public void setBlockCount(long aBlockCount)
getFreeBlocks
public long getFreeBlocks()
setFreeBlocks
public void setFreeBlocks(long aFreeBlocks)
getRootBlock
public long getRootBlock()
setRootBlock
public void setRootBlock(long aRootBlock)
getJournalBlock
public long getJournalBlock()
setJournalBlock
public void setJournalBlock(long aJournalBlock)
getJournalDev
public long getJournalDev()
setJournalDev
public void setJournalDev(long aJournalDev)
getOrigJournalSize
public long getOrigJournalSize()
setOrigJournalSize
public void setOrigJournalSize(long aOrigJournalSize)
getJournalTransMax
public long getJournalTransMax()
setJournalTransMax
public void setJournalTransMax(long aJournalTransMax)
getJournalBlockCount
public long getJournalBlockCount()
setJournalBlockCount
public void setJournalBlockCount(long aJournalBlockCount)
getJournalMaxBatch
public long getJournalMaxBatch()
setJournalMaxBatch
public void setJournalMaxBatch(long aJournalMaxBatch)
getJournalCommitAge
public long getJournalCommitAge()
setJournalCommitAge
public void setJournalCommitAge(long aJournalCommitAge)
getJournalTransAge
public long getJournalTransAge()
setJournalTransAge
public void setJournalTransAge(long aJournalTransAge)
getBlockSize
public int getBlockSize()
setBlockSize
public void setBlockSize(int aBlockSize)
getOldMaxSize
public int getOldMaxSize()
setOldMaxSize
public void setOldMaxSize(int aOldMaxSize)
getCurrSize
public int getCurrSize()
setCurrSize
public void setCurrSize(int aCurrSize)
getState
public int getState()
setState
public void setState(int aState)
getMagic
public byte[] getMagic()
setMagic
public void setMagic(byte[] aMagic)
getHashFunc
public long getHashFunc()
setHashFunc
public void setHashFunc(long aHashFunc)
getTreeHeight
public int getTreeHeight()
setTreeHeight
public void setTreeHeight(int aTreeHeight)
getBitmapBlocks
public int getBitmapBlocks()
setBitmapBlocks
public void setBitmapBlocks(int aBitmapBlocks)
getVersion
public int getVersion()
setVersion
public void setVersion(int aVersion)
getReserved
public int getReserved()
setReserved
public void setReserved(int aReserved)
getInodeGen
public long getInodeGen()
setInodeGen
public void setInodeGen(long aInodeGen)
getFlags
public long getFlags()
setFlags
public void setFlags(long aFlags)
getUniqueID
public byte[] getUniqueID()
setUniqueID
public void setUniqueID(byte[] aUniqueID)
getLabel
public byte[] getLabel()
setLabel
public void setLabel(byte[] aLabel)
loadFromBuffer
public void loadFromBuffer(byte[] buffer,
int offset)
throws FsException
- Load from a buffer containint the superblock. We assume that the superblock
begins at the specified offset within the buffer
- Specified by:
loadFromBuffer in interface DiskStructure
- Parameters:
buffer - a byte[] containing data to be read in populating the objectoffset - a int indicating the offset within the buffer to start parsing.
- Throws:
FsException - if a parse error occurs.