|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrossi.fstools.fs.ext2fs.Ext2Inode
Representation of ext2/3 inode.
On disk the superblock looks like this:
31 24 16 8 0
--------------------------------------
0000 | Mode | UID |
--------------------------------------
0004 | Size |
--------------------------------------
0008 | ATime |
--------------------------------------
000C | CTime |
--------------------------------------
0010 | MTime |
--------------------------------------
0014 | DTime |
--------------------------------------
0018 | GID | Num Links |
--------------------------------------
001C | Block Count |
--------------------------------------
0020 | Flags |
--------------------------------------
0024 | Reserved |
--------------------------------------
0028 | Direct Block 0 |
--------------------------------------
:
--------------------------------------
0054 | Direct Block 11 |
--------------------------------------
0058 | Indirect Block |
--------------------------------------
005C | Double Indirect Block |
--------------------------------------
0060 | Triple Indirect Block |
--------------------------------------
0064 | File version |
--------------------------------------
0068 | File ACL |
--------------------------------------
006C | Dir ACL |
--------------------------------------
0070 | Fragment address |
--------------------------------------
0074 | Frag | fsize | pad |
--------------------------------------
0078 | UID high | GID High |
--------------------------------------
007C | Reserved |
--------------------------------------
| Field Summary | |
protected long |
accessTime
|
protected byte[] |
blockData
|
protected long |
blocks
|
protected long |
changedTime
|
protected long |
deletedTime
|
protected long |
dirACL
|
protected long[] |
directBlocks
|
protected long |
doubleIndirectBlock
|
static int |
EXT2_GOOD_OLD_INODE_SIZE
|
static int |
EXT2_N_BLOCKS
|
static int |
EXT2_NDIR_BLOCKS
|
protected long |
fileACL
|
protected long |
fileVersion
|
protected long |
flags
|
protected long |
fragAddr
|
protected int |
fragNum
|
protected int |
fragSize
|
protected int |
gidHigh
|
protected int |
gidLow
|
protected long |
indirectBlock
|
protected int |
mode
|
protected long |
modifyTime
|
protected int |
numLinks
|
protected long |
sizeLow
|
protected long |
tripleIndirectBlock
|
protected int |
uidHigh
|
protected int |
uidLow
|
| Fields inherited from interface rossi.fstools.fs.Inode |
BLOCKDEV_MODE, CHARDEV_MODE, DIRECTORY_MODE, FIFO_MODE, FILE_MODE, FILETYPE_MASK, SOCKET_MODE, SYMLINK_MODE |
| Constructor Summary | |
Ext2Inode()
|
|
| Method Summary | |
long |
getAccessTime()
Get the time the data was last accessed. |
byte[] |
getBlockData()
Get the block data as a byte array. |
long |
getBlocks()
This field is really the number of SECTORS the file takes up on disk. |
long |
getChangedTime()
Get the time this Inode metadata was last changed. |
int |
getDataSize()
Get the size in bytes of the structure. |
long |
getDeletedTime()
|
long |
getDirACL()
This field is overloaded so that it contains the most significant 32 bits of the file size when mode == FILE_MODE |
long |
getDirectBlock(int blocknum)
Get a direct block given its index. |
long[] |
getDirectBlocks()
Get the direct block pointers as an array. |
long |
getDoubleIndirectBlock()
Get the double indirect block pointer. |
long |
getFileACL()
|
long |
getFileVersion()
|
long |
getFlags()
|
long |
getFragAddr()
|
int |
getFragNum()
|
int |
getFragSize()
|
int |
getGidHigh()
|
int |
getGidLow()
|
long |
getGroupId()
Get the group id of the object's owner. |
long |
getIndirectBlock()
Get the indirect block pointer. |
int |
getMode()
Get the mode of the file. |
long |
getModifyTime()
Get the time the data was last modified. |
long |
getNumLinks()
Get the number of hard links to this file. |
long |
getSize()
Get the size of the data associated with the object. |
long |
getSizeLow()
Get the low 32 bits of the file size. |
long |
getTripleIndirectBlock()
Get the triple indirect block pointer. |
int |
getUidHigh()
|
int |
getUidLow()
Get the low 16 bits of the user id. |
long |
getUserId()
Get the user id of the object's owner. |
void |
loadFromBuffer(byte[] buffer,
int offset)
Loads the object from a memory buffer |
void |
setAccessTime(long aAccessTime)
|
void |
setBlockData(byte[] aBlockData)
|
void |
setBlocks(long aBlocks)
|
void |
setChangedTime(long aChangedTime)
|
void |
setDeletedTime(long aDeletedTime)
|
void |
setDirACL(long aDirACL)
|
void |
setDirectBlocks(long[] aDirectBlocks)
|
void |
setDoubleIndirectBlock(long aDoubleIndirectBlock)
|
void |
setFileACL(long aFileACL)
|
void |
setFileVersion(long aFileVersion)
|
void |
setFlags(long aFlags)
|
void |
setFragAddr(long aFragAddr)
|
void |
setFragNum(int aFragNum)
|
void |
setFragSize(int aFragSize)
|
void |
setGidHigh(int aGidHigh)
|
void |
setGidLow(int aGidLow)
|
void |
setGroupId(long gid)
|
void |
setIndirectBlock(long aIndirectBlock)
|
void |
setMode(int aMode)
Set the mode. |
void |
setModifyTime(long aModifyTime)
|
void |
setNumLinks(long aNumLinks)
|
void |
setSize(long s)
|
void |
setSizeLow(long aSizeLow)
|
void |
setTripleIndirectBlock(long aTripleIndirectBlock)
|
void |
setUidHigh(int aUidHigh)
|
void |
setUidLow(int aUidLow)
|
void |
setUserId(long uid)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int mode
protected int uidLow
protected long sizeLow
protected long accessTime
protected long modifyTime
protected long changedTime
protected long deletedTime
protected int gidLow
protected int numLinks
protected long blocks
protected long flags
protected long[] directBlocks
protected long indirectBlock
protected long doubleIndirectBlock
protected long tripleIndirectBlock
protected byte[] blockData
protected long fileVersion
protected long fileACL
protected long dirACL
protected long fragAddr
protected int fragNum
protected int fragSize
protected int uidHigh
protected int gidHigh
public static int EXT2_NDIR_BLOCKS
public static int EXT2_N_BLOCKS
public static int EXT2_GOOD_OLD_INODE_SIZE
| Constructor Detail |
public Ext2Inode()
| Method Detail |
public int getDataSize()
DiskStructure
getDataSize in interface DiskStructurepublic int getMode()
getMode in interface Inodepublic void setMode(int aMode)
Inode
setMode in interface InodeaMode - the mode.Inode.getMode()public int getUidLow()
public void setUidLow(int aUidLow)
public long getSizeLow()
public void setSizeLow(long aSizeLow)
public long getAccessTime()
Inode
getAccessTime in interface Inodepublic void setAccessTime(long aAccessTime)
setAccessTime in interface Inodepublic long getModifyTime()
Inode
getModifyTime in interface Inodepublic void setModifyTime(long aModifyTime)
setModifyTime in interface Inodepublic long getChangedTime()
Inode
getChangedTime in interface Inodepublic void setChangedTime(long aChangedTime)
setChangedTime in interface Inodepublic long getDeletedTime()
public void setDeletedTime(long aDeletedTime)
public int getGidLow()
public void setGidLow(int aGidLow)
public long getNumLinks()
Inode
getNumLinks in interface Inodepublic void setNumLinks(long aNumLinks)
setNumLinks in interface Inodepublic long getBlocks()
public void setBlocks(long aBlocks)
public long getFlags()
public void setFlags(long aFlags)
public long[] getDirectBlocks()
getDirectBlock(int)public void setDirectBlocks(long[] aDirectBlocks)
public long getDirectBlock(int blocknum)
blocknum - which of the 12 direct blocks to return
public long getIndirectBlock()
public void setIndirectBlock(long aIndirectBlock)
public long getDoubleIndirectBlock()
public void setDoubleIndirectBlock(long aDoubleIndirectBlock)
public long getTripleIndirectBlock()
public void setTripleIndirectBlock(long aTripleIndirectBlock)
public byte[] getBlockData()
public void setBlockData(byte[] aBlockData)
public long getFileVersion()
public void setFileVersion(long aFileVersion)
public long getFileACL()
public void setFileACL(long aFileACL)
public long getDirACL()
public void setDirACL(long aDirACL)
public long getFragAddr()
public void setFragAddr(long aFragAddr)
public int getFragNum()
public void setFragNum(int aFragNum)
public int getFragSize()
public void setFragSize(int aFragSize)
public int getUidHigh()
public void setUidHigh(int aUidHigh)
public int getGidHigh()
public void setGidHigh(int aGidHigh)
public long getUserId()
Inode
getUserId in interface Inodepublic void setUserId(long uid)
setUserId in interface Inodepublic void setGroupId(long gid)
setGroupId in interface Inodepublic long getGroupId()
Inode
getGroupId in interface Inodepublic long getSize()
Inode
getSize in interface Inodepublic void setSize(long s)
setSize in interface Inode
public void loadFromBuffer(byte[] buffer,
int offset)
throws FsException
DiskStructure
loadFromBuffer in interface DiskStructurebuffer - a byte[] containing data to be read in populating the objectoffset - a int indicating the offset within the buffer to start parsing.
FsException - if a parse error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||