class VnodeF2fs
Defined at line 62 of file ../../src/storage/f2fs/vnode.h
Public Methods
void VnodeF2fs (F2fs * fs, ino_t ino, umode_t mode, LockedPage node_page)
Defined at line 29 of file ../../src/storage/f2fs/vnode.cc
void ~VnodeF2fs ()
Defined at line 69 of file ../../src/storage/f2fs/vnode.cc
uint32_t InlineDataOffset ()
Defined at line 70 of file ../../src/storage/f2fs/vnode.h
fuchsia_io::NodeProtocolKinds GetProtocols ()
Defined at line 71 of file ../../src/storage/f2fs/vnode.cc
zx_status_t GetVmo (fuchsia_io::wire::VmoFlags flags, zx::vmo * out_vmo)
For fs::PagedVnode
Defined at line 99 of file ../../src/storage/f2fs/vnode.cc
void VmoRead (uint64_t offset, uint64_t length)
Defined at line 164 of file ../../src/storage/f2fs/vnode.cc
zx::result<size_t> CreateAndPopulateVmo (zx::vmo & vmo, const size_t offset, const size_t length)
Defined at line 184 of file ../../src/storage/f2fs/vnode.cc
zx_status_t GetNewDataPage (pgoff_t index, LockedPage * out)
Reserve space for a new block
Defined at line 71 of file ../../src/storage/f2fs/data.cc
zx_status_t ReserveNewBlock (LockedPage & node_page, size_t ofs_in_node)
Defined at line 25 of file ../../src/storage/f2fs/data.cc
ino_t GetKey ()
Defined at line 89 of file ../../src/storage/f2fs/vnode.h
block_t GetBlockAddr (LockedPage & page)
Return a block addr for page. It allocates a block addr as needed.
Defined at line 172 of file ../../src/storage/f2fs/data.cc
void UpdateExtentCache (pgoff_t file_offset, block_t blk_addr, uint32_t len)
Defined at line 43 of file ../../src/storage/f2fs/data.cc
zx::result<block_t> LookupExtentCacheBlock (pgoff_t file_offset)
Defined at line 57 of file ../../src/storage/f2fs/data.cc
size_t MaxInlineData ()
Defined at line 74 of file ../../src/storage/f2fs/vnode.h
void SetMode (const umode_t & mode)
Defined at line 75 of file ../../src/storage/f2fs/vnode.cc
size_t MaxInlineDentry ()
Defined at line 75 of file ../../src/storage/f2fs/vnode.h
umode_t GetMode ()
Defined at line 77 of file ../../src/storage/f2fs/vnode.cc
size_t GetAddrsPerInode ()
Defined at line 78 of file ../../src/storage/f2fs/vnode.h
bool IsDir ()
Defined at line 79 of file ../../src/storage/f2fs/vnode.cc
bool IsReg ()
Defined at line 81 of file ../../src/storage/f2fs/vnode.cc
bool IsLink ()
Defined at line 83 of file ../../src/storage/f2fs/vnode.cc
bool IsChr ()
Defined at line 85 of file ../../src/storage/f2fs/vnode.cc
bool IsBlk ()
Defined at line 87 of file ../../src/storage/f2fs/vnode.cc
bool IsSock ()
Defined at line 89 of file ../../src/storage/f2fs/vnode.cc
bool IsFifo ()
Defined at line 91 of file ../../src/storage/f2fs/vnode.cc
bool HasGid ()
Defined at line 93 of file ../../src/storage/f2fs/vnode.cc
void fbl_recycle ()
Defined at line 94 of file ../../src/storage/f2fs/vnode.h
bool IsMeta ()
Defined at line 97 of file ../../src/storage/f2fs/vnode.cc
bool IsNode ()
Defined at line 95 of file ../../src/storage/f2fs/vnode.cc
F2fs * fs ()
Defined at line 96 of file ../../src/storage/f2fs/vnode.h
ino_t Ino ()
Defined at line 98 of file ../../src/storage/f2fs/vnode.h
void IncrementLink ()
Defined at line 189 of file ../../src/storage/f2fs/vnode.h
void ClearLinkCount ()
Defined at line 193 of file ../../src/storage/f2fs/vnode.h
void DecrementLink ()
Defined at line 197 of file ../../src/storage/f2fs/vnode.h
uint32_t GetLinkCount ()
Defined at line 201 of file ../../src/storage/f2fs/vnode.h
void SetName (std::string_view name)
Defined at line 219 of file ../../src/storage/f2fs/vnode.h
bool IsSameName (std::string_view name)
Defined at line 224 of file ../../src/storage/f2fs/vnode.h
const std::string & GetNameView ()
Defined at line 228 of file ../../src/storage/f2fs/vnode.h
void AddBlocks (const block_t nblocks)
Defined at line 233 of file ../../src/storage/f2fs/vnode.h
void RemoveBlocks (const block_t nblocks)
Defined at line 237 of file ../../src/storage/f2fs/vnode.h
zx::result<fs::VnodeAttributes> GetAttributes ()
Defined at line 323 of file ../../src/storage/f2fs/vnode.cc
fs::VnodeAttributesQuery SupportedMutableAttributes ()
Defined at line 343 of file ../../src/storage/f2fs/vnode.cc
zx::result<> UpdateAttributes (const fs::VnodeAttributesUpdate & attributes)
Defined at line 347 of file ../../src/storage/f2fs/vnode.cc
void VmoDirty (uint64_t offset, uint64_t length)
Defined at line 240 of file ../../src/storage/f2fs/vnode.cc
block_t GetBlockCount ()
Defined at line 241 of file ../../src/storage/f2fs/vnode.h
void SetParentNid (const ino_t pino)
Defined at line 252 of file ../../src/storage/f2fs/vnode.h
ino_t GetParentNid ()
Defined at line 253 of file ../../src/storage/f2fs/vnode.h
void OnNoPagedVmoClones ()
Defined at line 253 of file ../../src/storage/f2fs/vnode.cc
void IncreaseDirtyPageCount ()
Defined at line 255 of file ../../src/storage/f2fs/vnode.h
void DecreaseDirtyPageCount ()
Defined at line 256 of file ../../src/storage/f2fs/vnode.h
block_t GetDirtyPageCount ()
Defined at line 257 of file ../../src/storage/f2fs/vnode.h
void SetUid (const uid_t uid)
Defined at line 259 of file ../../src/storage/f2fs/vnode.h
void SetGid (const gid_t gid)
Defined at line 260 of file ../../src/storage/f2fs/vnode.h
template <typename T>
void SetTime (const timespec & time)
Defined at line 263 of file ../../src/storage/f2fs/vnode.h
template <typename U>
void SetTime ()
Defined at line 268 of file ../../src/storage/f2fs/vnode.h
void ResetTime ()
Defined at line 272 of file ../../src/storage/f2fs/vnode.h
void SetAdvise (const FAdvise bit)
Defined at line 287 of file ../../src/storage/f2fs/vnode.h
bool IsAdviseSet (const FAdvise bit)
Defined at line 288 of file ../../src/storage/f2fs/vnode.h
void SetInlineXattrSize (const uint16_t num_addrs)
Defined at line 297 of file ../../src/storage/f2fs/vnode.h
bool SetFlag (const InodeInfoFlag & flag)
Release-acquire ordering for Set/ClearFlag and TestFlag
Defined at line 300 of file ../../src/storage/f2fs/vnode.h
void ClearFlag (const InodeInfoFlag & flag)
Defined at line 303 of file ../../src/storage/f2fs/vnode.h
bool TestFlag (const InodeInfoFlag & flag)
Defined at line 306 of file ../../src/storage/f2fs/vnode.h
zx_status_t FindPage (pgoff_t index, fbl::RefPtr<Page> * out)
Defined at line 314 of file ../../src/storage/f2fs/vnode.h
std::vector<LockedPage> FindLockedPages (pgoff_t start, pgoff_t end)
Defined at line 318 of file ../../src/storage/f2fs/vnode.h
zx_status_t GrabLockedPage (pgoff_t index, LockedPage * out)
Defined at line 322 of file ../../src/storage/f2fs/vnode.h
zx::result<std::vector<fbl::RefPtr<Page>>> GrabPages (pgoff_t start, pgoff_t end)
Defined at line 326 of file ../../src/storage/f2fs/vnode.h
zx::result<std::vector<LockedPage>> GrabLockedPages (pgoff_t start, pgoff_t end)
Defined at line 330 of file ../../src/storage/f2fs/vnode.h
zx::result<LockedPage> FindVictimPage (pgoff_t index)
Defined at line 334 of file ../../src/storage/f2fs/vnode.h
size_t GetPageCount ()
Defined at line 337 of file ../../src/storage/f2fs/vnode.h
std::vector<LockedPage> InvalidatePages (pgoff_t start, pgoff_t end, bool zero)
Defined at line 339 of file ../../src/storage/f2fs/vnode.h
DirEntryCache & GetDirEntryCache ()
Defined at line 344 of file ../../src/storage/f2fs/vnode.h
VmoManager & GetVmoManager ()
Defined at line 345 of file ../../src/storage/f2fs/vnode.h
const VmoManager & GetVmoManager ()
Defined at line 346 of file ../../src/storage/f2fs/vnode.h
uint8_t GetDirLevel ()
Defined at line 349 of file ../../src/storage/f2fs/vnode.h
template <typename T>
const timespec & GetTime ()
Defined at line 351 of file ../../src/storage/f2fs/vnode.h
zx_status_t RecoverInlineData (NodePage & node_page)
Defined at line 358 of file ../../src/storage/f2fs/vnode.h
nid_t XattrNid ()
Defined at line 365 of file ../../src/storage/f2fs/vnode.h
void SetBlockCount (const block_t blocks)
Defined at line 367 of file ../../src/storage/f2fs/vnode.h
FileCache & GetFileCache ()
Defined at line 368 of file ../../src/storage/f2fs/vnode.h
void ResetFileCache ()
Defined at line 369 of file ../../src/storage/f2fs/vnode.h
ExtentTree & GetExtentTree ()
Defined at line 370 of file ../../src/storage/f2fs/vnode.h
bool HasPagedVmo ()
Defined at line 371 of file ../../src/storage/f2fs/vnode.h
void ClearAdvise (const FAdvise bit)
Defined at line 372 of file ../../src/storage/f2fs/vnode.h
void SetDirLevel (const uint8_t level)
Defined at line 373 of file ../../src/storage/f2fs/vnode.h
pgoff_t Writeback (bool is_sync, bool is_reclaim)
Defined at line 374 of file ../../src/storage/f2fs/vnode.h
void InitializeFromPage (LockedPage & node_page)
Defined at line 658 of file ../../src/storage/f2fs/vnode.cc
zx_status_t CreateFileCacheUnsafe (uint64_t nbytes)
Defined at line 631 of file ../../src/storage/f2fs/vnode.cc
zx_status_t CreateFileCache (uint64_t nbytes)
Defined at line 626 of file ../../src/storage/f2fs/vnode.cc
void Sync (SyncCallback closure)
Defined at line 740 of file ../../src/storage/f2fs/vnode.cc
zx_status_t SyncFile (bool datasync)
Defined at line 781 of file ../../src/storage/f2fs/vnode.cc
void ReleasePagedVmo ()
Defined at line 571 of file ../../src/storage/f2fs/vnode.cc
zx_status_t InitInodeMetadata ()
Defined at line 1181 of file ../../src/storage/f2fs/vnode.cc
zx_status_t InitInodeMetadataUnsafe ()
Defined at line 1186 of file ../../src/storage/f2fs/vnode.cc
zx::result<LockedPage> NewInodePage ()
Defined at line 1223 of file ../../src/storage/f2fs/vnode.cc
void UpdateInodePage (LockedPage & inode_page, bool checkpoint)
Defined at line 421 of file ../../src/storage/f2fs/vnode.cc
void UpdateInodePageUnsafe (LockedPage & inode_page, bool update_size)
Defined at line 426 of file ../../src/storage/f2fs/vnode.cc
zx_status_t DoTruncate (size_t len)
truncate
Defined at line 508 of file ../../src/storage/f2fs/vnode.cc
zx_status_t TruncateBlocks (uint64_t from)
Defined at line 521 of file ../../src/storage/f2fs/vnode.cc
void TruncateNode (LockedPage & page)
Defined at line 907 of file ../../src/storage/f2fs/vnode.cc
block_t TruncateDnodeAddrs (LockedPage & dnode, size_t offset, size_t count)
Defined at line 922 of file ../../src/storage/f2fs/vnode.cc
zx::result<size_t> TruncateDnode (nid_t nid)
Defined at line 947 of file ../../src/storage/f2fs/vnode.cc
zx::result<size_t> TruncateNodes (nid_t start_nid, size_t nofs, size_t ofs, size_t depth)
Defined at line 967 of file ../../src/storage/f2fs/vnode.cc
zx_status_t TruncatePartialNodes (const Inode & inode, const size_t (&)[4] offset, size_t depth)
Defined at line 1032 of file ../../src/storage/f2fs/vnode.cc
zx_status_t TruncateInodeBlocks (pgoff_t from)
All the block addresses of data and nodes should be nullified.
Defined at line 1072 of file ../../src/storage/f2fs/vnode.cc
zx_status_t InvalidateBlocks (size_t from)
Defined at line 594 of file ../../src/storage/f2fs/vnode.cc
zx_status_t TruncateHole (pgoff_t pg_start, pgoff_t pg_end, bool evict)
Defined at line 536 of file ../../src/storage/f2fs/vnode.cc
zx_status_t TruncateHoleUnsafe (pgoff_t pg_start, pgoff_t pg_end, bool evict)
Defined at line 541 of file ../../src/storage/f2fs/vnode.cc
void SetOrphan ()
handling orphans
Defined at line 887 of file ../../src/storage/f2fs/vnode.cc
zx_status_t PurgeInodeBlock ()
Defined at line 1163 of file ../../src/storage/f2fs/vnode.cc
void PurgeDataBlocks ()
Defined at line 578 of file ../../src/storage/f2fs/vnode.cc
void PurgeUnsafe ()
Defined at line 1537 of file ../../src/storage/f2fs/vnode.cc
void Purge ()
Defined at line 1532 of file ../../src/storage/f2fs/vnode.cc
zx::result<std::vector<block_t>> GetAddresses (const std::vector<pgoff_t> & indices)
Returns the block addresses for |indices| or |index|, reserving space as needed.
Defined at line 285 of file ../../src/storage/f2fs/data.cc
zx::result<std::vector<block_t>> GetAddresses (pgoff_t index, size_t count)
Defined at line 336 of file ../../src/storage/f2fs/data.cc
zx::result<std::vector<block_t>> FindAddresses (const std::vector<pgoff_t> & indices)
Returns the block addresses for |indices| or |index| without reservation.
Defined at line 342 of file ../../src/storage/f2fs/data.cc
zx::result<std::vector<block_t>> FindAddresses (pgoff_t index, size_t count)
Defined at line 381 of file ../../src/storage/f2fs/data.cc
zx::result<std::vector<LockedPage>> WriteBegin (const size_t offset, const size_t len)
It reserves space from |offset| to |offset| + |len| before dirtying the corresponding pages.
Defined at line 262 of file ../../src/storage/f2fs/data.cc
pgoff_t Writeback (WritebackOperation & operation)
TODO: Consider using a global lock as below
if (!IsDir())
mutex_lock(
&superblock
_info->writepages);
Writeback()
if (!IsDir())
mutex_unlock(
&superblock
_info->writepages);
fs()->RemoveDirtyDirInode(this);
Defined at line 1243 of file ../../src/storage/f2fs/vnode.cc
zx::result<NodePath> GetNodePath (pgoff_t block)
The maximum depth is four.
Offset[0] indicates inode offset.
Defined at line 1421 of file ../../src/storage/f2fs/vnode.cc
zx::result<PageBitmap> GetBitmap (fbl::RefPtr<Page> dentry_page)
Defined at line 883 of file ../../src/storage/f2fs/vnode.cc
void Notify (std::string_view name, fuchsia_io::wire::WatchEvent event)
Defined at line 828 of file ../../src/storage/f2fs/vnode.cc
zx_status_t WatchDir (fs::FuchsiaVfs * vfs, fuchsia_io::wire::WatchMask mask, uint32_t options, fidl::ServerEnd<fuchsia_io::DirectoryWatcher> watcher)
Defined at line 832 of file ../../src/storage/f2fs/vnode.cc
bool ExtentCacheAvailable ()
Defined at line 838 of file ../../src/storage/f2fs/vnode.cc
void InitExtentTree ()
Defined at line 843 of file ../../src/storage/f2fs/vnode.cc
void SetSize (const size_t nbytes)
It adjusts both the size and the contents of its VMO.
If the vnode uses a paged VMO, it can invoke VmoDirty() as needed, and the kernel then
guarantees that the VMO’s contents beyond |len| are zero-initialized.
Defined at line 767 of file ../../src/storage/f2fs/vnode.cc
uint64_t GetSize (bool update_checkpointed_size)
Defined at line 772 of file ../../src/storage/f2fs/vnode.cc
bool IsColdFile ()
Coldness identification:
- Mark cold files in InodeInfo
- Mark cold node blocks in their node footer
- Mark cold data pages in page cache
Defined at line 1306 of file ../../src/storage/f2fs/vnode.cc
void SetColdFile ()
Set multimedia files as cold files for hot/cold data separation
Defined at line 1288 of file ../../src/storage/f2fs/vnode.cc
bool SetDirty ()
Set dirty flag and insert |this| to VnodeCache::dirty_list_.
Defined at line 724 of file ../../src/storage/f2fs/vnode.cc
bool ClearDirty ()
Defined at line 731 of file ../../src/storage/f2fs/vnode.cc
bool IsDirty ()
Defined at line 738 of file ../../src/storage/f2fs/vnode.cc
bool IsActive ()
Defined at line 881 of file ../../src/storage/f2fs/vnode.cc
void PutRefPtr ()
Defined at line 871 of file ../../src/storage/f2fs/vnode.cc
zx::result<fbl::RefPtr<VnodeF2fs>> GetRefPtr ()
Defined at line 854 of file ../../src/storage/f2fs/vnode.cc
block_t GetReadBlockSize (block_t start_block, block_t req_size, block_t end_block)
void CleanupCache ()
Defined at line 1281 of file ../../src/storage/f2fs/vnode.cc
zx_status_t RecoverInode (NodePage & node_page)
Defined at line 1496 of file ../../src/storage/f2fs/vnode.cc
zx_status_t SetExtendedAttribute (XattrIndex index, std::string_view name, std::span<const uint8_t> value, XattrOption option)
for testing
Defined at line 1308 of file ../../src/storage/f2fs/vnode.cc
zx::result<size_t> GetExtendedAttribute (XattrIndex index, std::string_view name, std::span<uint8_t> out)
Defined at line 1390 of file ../../src/storage/f2fs/vnode.cc
Protected Methods
zx_status_t ClonePagedVmo (fuchsia_io::wire::VmoFlags flags, size_t size, zx::vmo * out_vmo)
Defined at line 125 of file ../../src/storage/f2fs/vnode.cc
void SetPagedVmoName ()
Defined at line 118 of file ../../src/storage/f2fs/vnode.cc
block_t GetBlockAddrOnDataSegment (LockedPage & page)
Defined at line 203 of file ../../src/storage/f2fs/data.cc
zx::result<size_t> CreatePagedVmo (uint64_t size)
Defined at line 107 of file ../../src/storage/f2fs/vnode.cc
const std::string & GetNameViewUnsafe ()
Defined at line 382 of file ../../src/storage/f2fs/vnode.h
void AddBlocksUnsafe (const block_t nblocks)
Defined at line 383 of file ../../src/storage/f2fs/vnode.h
void RemoveBlocksUnsafe (const block_t nblocks)
Defined at line 390 of file ../../src/storage/f2fs/vnode.h
block_t GetBlockCountUnsafe ()
Defined at line 396 of file ../../src/storage/f2fs/vnode.h
void IncrementLinkUnsafe ()
Defined at line 398 of file ../../src/storage/f2fs/vnode.h
void ClearLinkCountUnsafe ()
Defined at line 402 of file ../../src/storage/f2fs/vnode.h
void DecrementLinkUnsafe ()
Defined at line 406 of file ../../src/storage/f2fs/vnode.h
uint32_t GetLinkCountUnsafe ()
Defined at line 410 of file ../../src/storage/f2fs/vnode.h
VmoManager & vmo_manager ()
Defined at line 416 of file ../../src/storage/f2fs/vnode.h
const SuperblockInfo & GetSuperblockInfo ()
Defined at line 430 of file ../../src/storage/f2fs/vnode.h
uint16_t GetExtraSize ()
Defined at line 431 of file ../../src/storage/f2fs/vnode.h
uint64_t GetCurrentDepth ()
Defined at line 432 of file ../../src/storage/f2fs/vnode.h
void SetCurrentDepth (uint64_t depth)
Defined at line 433 of file ../../src/storage/f2fs/vnode.h
zx_status_t CloseNode ()
Defined at line 1520 of file ../../src/storage/f2fs/vnode.cc
void RecycleNode ()
Defined at line 285 of file ../../src/storage/f2fs/vnode.cc
void ReportPagerError (const uint32_t op, const uint64_t offset, const uint64_t length, const zx_status_t err)
Defined at line 259 of file ../../src/storage/f2fs/vnode.cc
void ReportPagerErrorUnsafe (const uint32_t op, const uint64_t offset, const uint64_t length, const zx_status_t err)
Defined at line 265 of file ../../src/storage/f2fs/vnode.cc
bool NeedToSyncDir ()
Defined at line 823 of file ../../src/storage/f2fs/vnode.cc
bool NeedToCheckpoint ()
Defined at line 742 of file ../../src/storage/f2fs/vnode.cc
bool NeedToLogInode ()
Defined at line 777 of file ../../src/storage/f2fs/vnode.cc