Documentation ¶
Index ¶
- Constants
- func MaxFileSize() uint64
- func NfstimeNow() nfstypes.Nfstime3
- type Inode
- func (ip *Inode) DecLink(atxn *alloctxn.AllocTxn) bool
- func (ip *Inode) Encode() []byte
- func (ip *Inode) FreeInode(atxn *alloctxn.AllocTxn)
- func (ip *Inode) InitInode(inum common.Inum, kind nfstypes.Ftype3)
- func (ip *Inode) IsShrinking() bool
- func (ip *Inode) MkFattr() nfstypes.Fattr3
- func (ip *Inode) Read(atxn *alloctxn.AllocTxn, offset uint64, bytesToRead uint64) ([]byte, bool)
- func (ip *Inode) Resize(atxn *alloctxn.AllocTxn, sz uint64) bool
- func (ip *Inode) Shrink(op *alloctxn.AllocTxn) bool
- func (ip *Inode) String() string
- func (ip *Inode) Write(atxn *alloctxn.AllocTxn, offset uint64, count uint64, dataBuf []byte) (uint64, bool)
- func (ip *Inode) WriteInode(atxn *alloctxn.AllocTxn)
Constants ¶
View Source
const ( NBLKINO uint64 = 10 // # blk in an inode's blks array NDIRECT uint64 = NBLKINO - 2 INDIRECT uint64 = NBLKINO - 2 DINDIRECT uint64 = NBLKINO - 1 NBLKBLK uint64 = disk.BlockSize / 8 // # blkno per block NINDLEVEL uint64 = 2 // # levels of indirection )
View Source
const NF3FREE nfstypes.Ftype3 = 0
Variables ¶
This section is empty.
Functions ¶
func MaxFileSize ¶
func MaxFileSize() uint64
func NfstimeNow ¶
Types ¶
type Inode ¶
type Inode struct { // in-memory info: Inum common.Inum Dcache *dcache.Dcache // the on-disk inode: Kind nfstypes.Ftype3 Nlink uint32 Gen uint64 Size uint64 // if ShrinkSize > Size, then the inode is in the process // of shrinking to Size. ShrinkSize is in block units ShrinkSize uint64 Atime nfstypes.Nfstime3 Mtime nfstypes.Nfstime3 // contains filtered or unexported fields }
func MkRootInode ¶
func MkRootInode() *Inode
func (*Inode) IsShrinking ¶
func (*Inode) Resize ¶
Resize updates the inode, but may not free immediately if the inode shrinks. It creates a new thread to free blocks in a separate transaction, if shrinking involves freeing many blocks. ShrinkSize tracks shrinking progress, and is initialized with the old size.
func (*Inode) Shrink ¶
Frees as many blocks as possible, and returns if more shrinking is necessary. 5: inode block, 2xbitmap block, indirect block, double indirect
func (*Inode) Write ¶
func (ip *Inode) Write(atxn *alloctxn.AllocTxn, offset uint64, count uint64, dataBuf []byte) (uint64, bool)
Returns number of bytes written and error
func (*Inode) WriteInode ¶
Click to show internal directories.
Click to hide internal directories.