84 uint32_t getInodeNumber() {
92 void updateInodeAttributes(
const File::Attributes& attributes, uint32_t mask);
93 bool changeInodeOwnership(
size_t uid,
size_t gid,
bool changeUid,
bool changeGid);
96 bool wipe(
bool allocationLockHeld =
false);
98 void extend(
size_t newSize);
99 void extend(
size_t newSize, uint64_t location, uint64_t size);
101 uint64_t maximumFileSize()
const;
103 static bool decodeAllocation(
const Inode&, uint32_t blockSize, uint32_t& blocks,
104 bool& inlineSymlink);
105 static bool encodeAllocation(uint32_t data, uint32_t indirect,
bool hasEa, uint32_t blockSize,
107 bool isInlineSymlink()
const;
108 void updateAllocatedSectorCount();
109 XattrStatus getXattr(
const StringView&,
void*,
size_t,
size_t&);
110 XattrStatus listXattrs(
void*,
size_t,
size_t&);
111 XattrStatus setXattr(
const StringView&,
const void*,
size_t,
unsigned);
114 uintptr_t readBlock(uint64_t location);
115 void writeBlock(uint64_t location);
117 void trackBlock(uint32_t block,
bool writeInode =
true);
119 bool pinBlock(uint64_t location);
120 void unpinBlock(uint64_t location);
122 bool sync(
size_t offset,
bool async);
125 XattrStatus changeXattr(
const StringView&,
const void*,
size_t,
unsigned,
bool remove);
126 bool resizeData(
size_t size);
127 bool trimToBlocks(
size_t keep,
bool allocationLockHeld =
false);
128 bool zeroRange(
size_t start,
size_t end);
136 bool collectMappingPages(uint32_t block,
unsigned depth,
size_t first,
size_t span,
143 size_t retainedData = 0;
148 bool prepareTrim(
size_t keep,
TrimPlan& plan,
bool allocationLockHeld =
false);
149 void commitTrim(
TrimPlan& plan,
bool allocationLockHeld =
false);
157 bool ensureLargeEnough(
size_t size, uint64_t location, uint64_t opsize,
bool onlyBlocks =
false,
158 bool nozeroblocks =
false);
164 bool ensureBlockLoaded(
size_t nBlock);
165 bool getBlockNumber(
size_t nBlock);
166 bool getBlockNumberIndirect(uint32_t inode_block,
size_t nBlocks,
size_t nBlock);
167 bool getBlockNumberBiindirect(uint32_t inode_block,
size_t nBlocks,
size_t nBlock);
168 bool getBlockNumberTriindirect(uint32_t inode_block,
size_t nBlocks,
size_t nBlock);
170 bool setBlockNumber(
size_t blockNum, uint32_t blockValue,
172 bool ensureWritableRange(
size_t location,
size_t length);
174 uint32_t modeToPermissions(uint32_t mode)
const;
175 uint32_t permissionsToMode(uint32_t permissions)
const;
179 uint32_t m_InodeNumber;
183 uint32_t& m_nMetadataBlocks;