|
The Pedigree Project 0.1
|
#include <Ext2Node.h>
Inheritance diagram for Ext2Node:
Collaboration diagram for Ext2Node:Classes | |
| class | DataShrinkPlan |
| struct | MappingPage |
| struct | TrimPlan |
Public Member Functions | |
| Ext2Node (uintptr_t inode_num, Inode *pInode, class Ext2Filesystem *pFs) | |
| virtual | ~Ext2Node () |
| Inode * | getInode () |
| uint32_t | getInodeNumber () |
| void | fileAttributeChanged (size_t size, size_t atime, size_t mtime, size_t ctime) |
| File::Attributes | inodeAttributes () const |
| void | updateInodeAttributes (const File::Attributes &attributes, uint32_t mask) |
| bool | changeInodeOwnership (size_t uid, size_t gid, bool changeUid, bool changeGid) |
| bool | wipe (bool allocationLockHeld=false) |
| void | extend (size_t newSize) |
| void | extend (size_t newSize, uint64_t location, uint64_t size) |
| uint64_t | maximumFileSize () const |
| bool | isInlineSymlink () const |
| void | updateAllocatedSectorCount () |
| XattrStatus | getXattr (const StringView &, void *, size_t, size_t &) |
| XattrStatus | listXattrs (void *, size_t, size_t &) |
| XattrStatus | setXattr (const StringView &, const void *, size_t, unsigned) |
| XattrStatus | removeXattr (const StringView &) |
| uintptr_t | readBlock (uint64_t location) |
| void | writeBlock (uint64_t location) |
| void | trackBlock (uint32_t block, bool writeInode=true) |
| bool | pinBlock (uint64_t location) |
| void | unpinBlock (uint64_t location) |
| bool | sync (size_t offset, bool async) |
Static Public Member Functions | |
| static bool | decodeAllocation (const Inode &, uint32_t blockSize, uint32_t &blocks, bool &inlineSymlink) |
| static bool | encodeAllocation (uint32_t data, uint32_t indirect, bool hasEa, uint32_t blockSize, uint32_t §ors) |
Protected Member Functions | |
| XattrStatus | changeXattr (const StringView &, const void *, size_t, unsigned, bool remove) |
| bool | resizeData (size_t size) |
| bool | trimToBlocks (size_t keep, bool allocationLockHeld=false) |
| bool | zeroRange (size_t start, size_t end) |
| bool | collectMappingPages (uint32_t block, unsigned depth, size_t first, size_t span, Vector< MappingPage > &pages) |
| bool | prepareTrim (size_t keep, TrimPlan &plan, bool allocationLockHeld=false) |
| void | commitTrim (TrimPlan &plan, bool allocationLockHeld=false) |
| bool | prepareDataShrink (size_t size, UniquePointer< File::PreparedShrink > &prepared) |
| bool | ensureLargeEnough (size_t size, uint64_t location, uint64_t opsize, bool onlyBlocks=false, bool nozeroblocks=false) |
| bool | addBlock (uint32_t blockValue, Vector< uint32_t > *pendingWrites=0) |
| void | writeBlockOrQueue (uint32_t block, Vector< uint32_t > *pendingWrites) |
| bool | ensureBlockLoaded (size_t nBlock) |
| bool | getBlockNumber (size_t nBlock) |
| bool | getBlockNumberIndirect (uint32_t inode_block, size_t nBlocks, size_t nBlock) |
| bool | getBlockNumberBiindirect (uint32_t inode_block, size_t nBlocks, size_t nBlock) |
| bool | getBlockNumberTriindirect (uint32_t inode_block, size_t nBlocks, size_t nBlock) |
| bool | setBlockNumber (size_t blockNum, uint32_t blockValue, Vector< uint32_t > *pendingWrites=nullptr) |
| bool | ensureWritableRange (size_t location, size_t length) |
| uint32_t | modeToPermissions (uint32_t mode) const |
| uint32_t | permissionsToMode (uint32_t permissions) const |
Protected Attributes | |
| Ext2InodeState * | m_State |
| Inode *& | m_pInode |
| uint32_t | m_InodeNumber |
| class Ext2Filesystem * | m_pExt2Fs |
| Vector< uint32_t > & | m_Blocks |
| uint32_t & | m_nMetadataBlocks |
| size_t & | m_nSize |
Private Member Functions | |
| Ext2Node (uintptr_t inode, Inode *metadata, Ext2Filesystem *filesystem, Ext2InodeState &admitted) | |
| Ext2Node (const Ext2Node &file) | |
| Ext2Node & | operator= (const Ext2Node &) |
Friends | |
| class | Ext2Filesystem |
A node in an ext2 filesystem.
Definition at line 65 of file Ext2Node.h.
|
private |
Copy constructors are hidden - unused!
Definition at line 145 of file Ext2Node.cc.
| Ext2Node::Ext2Node | ( | uintptr_t | inode_num, |
| Inode * | pInode, | ||
| class Ext2Filesystem * | pFs | ||
| ) |
Constructor, should be called only by a Filesystem.
Definition at line 136 of file Ext2Node.cc.
|
virtual |
Destructor
Definition at line 155 of file Ext2Node.cc.
|
protected |
Definition at line 519 of file Ext2Node.cc.
| bool Ext2Node::changeInodeOwnership | ( | size_t | uid, |
| size_t | gid, | ||
| bool | changeUid, | ||
| bool | changeGid | ||
| ) |
Definition at line 11 of file Ext2Node-quota.cc.
|
protected |
Definition at line 31 of file Ext2Xattr-write.cc.
|
protected |
Definition at line 42 of file Ext2Resize.cc.
|
protected |
Definition at line 123 of file Ext2Resize.cc.
|
static |
Definition at line 308 of file Ext2Xattr.cc.
|
static |
Definition at line 321 of file Ext2Xattr.cc.
|
protected |
Definition at line 331 of file Ext2Node.cc.
|
protected |
Ensures the inode is at least 'size' big. Set onlyBlocks to true to not change the actual data size, which can be useful for preallocation.
Definition at line 258 of file Ext2Node.cc.
References Vector< T >::count(), Ext2Filesystem::m_BlockSize, Filesystem::m_pDisk, Ext2Filesystem::writeBlock(), and Disk::zero().
Referenced by Ext2Filesystem::createNode(), Ext2File::preallocate(), and Ext2Symlink::writeBytewise().
Here is the caller graph for this function:
|
protected |
Definition at line 527 of file Ext2Node.cc.
| void Ext2Node::extend | ( | size_t | newSize | ) |
Definition at line 242 of file Ext2Node.cc.
| void Ext2Node::extend | ( | size_t | newSize, |
| uint64_t | location, | ||
| uint64_t | size | ||
| ) |
Definition at line 246 of file Ext2Node.cc.
| void Ext2Node::fileAttributeChanged | ( | size_t | size, |
| size_t | atime, | ||
| size_t | mtime, | ||
| size_t | ctime | ||
| ) |
Updates inode attributes.
Definition at line 567 of file Ext2Node.cc.
Referenced by Ext2Symlink::fileAttributeChanged(), Ext2Directory::fileAttributeChanged(), and Ext2File::fileAttributeChanged().
Here is the caller graph for this function:
|
protected |
Definition at line 343 of file Ext2Node.cc.
|
protected |
Definition at line 381 of file Ext2Node.cc.
|
protected |
Definition at line 361 of file Ext2Node.cc.
|
protected |
Definition at line 404 of file Ext2Node.cc.
|
inline |
Definition at line 80 of file Ext2Node.h.
|
inline |
Definition at line 84 of file Ext2Node.h.
| XattrStatus Ext2Node::getXattr | ( | const StringView & | name, |
| void * | output, | ||
| size_t | capacity, | ||
| size_t & | required | ||
| ) |
Definition at line 266 of file Ext2Xattr.cc.
| File::Attributes Ext2Node::inodeAttributes | ( | ) | const |
Definition at line 584 of file Ext2Node.cc.
| bool Ext2Node::isInlineSymlink | ( | ) | const |
Definition at line 330 of file Ext2Xattr.cc.
| XattrStatus Ext2Node::listXattrs | ( | void * | output, |
| size_t | capacity, | ||
| size_t & | required | ||
| ) |
Definition at line 287 of file Ext2Xattr.cc.
| uint64_t Ext2Node::maximumFileSize | ( | ) | const |
Definition at line 250 of file Ext2Node.cc.
|
protected |
Definition at line 672 of file Ext2Node.cc.
|
protected |
Definition at line 697 of file Ext2Node.cc.
| bool Ext2Node::pinBlock | ( | uint64_t | location | ) |
Definition at line 644 of file Ext2Node.cc.
|
protected |
Definition at line 201 of file Ext2Resize.cc.
|
protected |
Definition at line 68 of file Ext2Resize.cc.
| uintptr_t Ext2Node::readBlock | ( | uint64_t | location | ) |
Definition at line 159 of file Ext2Node.cc.
| XattrStatus Ext2Node::removeXattr | ( | const StringView & | name | ) |
Definition at line 119 of file Ext2Xattr-write.cc.
|
protected |
Definition at line 255 of file Ext2Resize.cc.
|
protected |
Definition at line 450 of file Ext2Node.cc.
| XattrStatus Ext2Node::setXattr | ( | const StringView & | name, |
| const void * | value, | ||
| size_t | length, | ||
| unsigned | flags | ||
| ) |
Definition at line 115 of file Ext2Xattr-write.cc.
| bool Ext2Node::sync | ( | size_t | offset, |
| bool | async | ||
| ) |
Definition at line 629 of file Ext2Node.cc.
| void Ext2Node::trackBlock | ( | uint32_t | block, |
| bool | writeInode = true |
||
| ) |
Definition at line 203 of file Ext2Node.cc.
|
protected |
Definition at line 164 of file Ext2Resize.cc.
| void Ext2Node::unpinBlock | ( | uint64_t | location | ) |
Definition at line 658 of file Ext2Node.cc.
| void Ext2Node::updateAllocatedSectorCount | ( | ) |
Definition at line 337 of file Ext2Xattr.cc.
| void Ext2Node::updateInodeAttributes | ( | const File::Attributes & | attributes, |
| uint32_t | mask | ||
| ) |
Definition at line 599 of file Ext2Node.cc.
| bool Ext2Node::wipe | ( | bool | allocationLockHeld = false | ) |
Wipes the node of data - frees all blocks.
Definition at line 217 of file Ext2Node.cc.
Referenced by Ext2Filesystem::retireInodeLocked(), and Ext2Symlink::truncate().
Here is the caller graph for this function:| void Ext2Node::writeBlock | ( | uint64_t | location | ) |
Definition at line 188 of file Ext2Node.cc.
|
protected |
Definition at line 427 of file Ext2Node.cc.
|
protected |
Definition at line 230 of file Ext2Resize.cc.
|
friend |
Definition at line 66 of file Ext2Node.h.
|
protected |
Definition at line 182 of file Ext2Node.h.
|
protected |
Definition at line 179 of file Ext2Node.h.
|
protected |
Definition at line 183 of file Ext2Node.h.
|
protected |
Definition at line 185 of file Ext2Node.h.
|
protected |
Definition at line 180 of file Ext2Node.h.
|
protected |
Definition at line 178 of file Ext2Node.h.
|
protected |
Definition at line 177 of file Ext2Node.h.