class VmoDiscardable

Defined at line 58 of file ../../src/storage/f2fs/vmo_manager.h

It manages the lifecycle of a discardable Vmo that Pages use in each vnode.

Public Methods

void VmoDiscardable (pgoff_t index, size_t size)

Defined at line 46 of file ../../src/storage/f2fs/vmo_manager.cc

void ~VmoDiscardable ()

Defined at line 50 of file ../../src/storage/f2fs/vmo_manager.cc

zx::result<bool> Lock (pgoff_t offset)

It ensures that |vmo_| keeps VMO_OP_LOCK as long as any Pages refer to it

by calling Page::GetVmo(). When a valid page gets a new access to a |this|,

it increases VmoMapping::active_pages_, and then decreases VmoMapping::active_pages_

in Unlock() as a active page is truncated. When VmoMapping::active_pages_ reaches

zero, Unlock() does VMO_OP_UNLOCK for page reclaim.

When VmoMapping::active_pages is zero with new page access, it tries VMO_OP_TRY_LOCK

to check which pages kernel has reclaimed.

Defined at line 57 of file ../../src/storage/f2fs/vmo_manager.cc

void VmoDiscardable ()

Defined at line 60 of file ../../src/storage/f2fs/vmo_manager.h

void VmoDiscardable (const VmoDiscardable & )

Defined at line 61 of file ../../src/storage/f2fs/vmo_manager.h

VmoDiscardable & operator= (const VmoDiscardable & )

Defined at line 62 of file ../../src/storage/f2fs/vmo_manager.h

void VmoDiscardable (const VmoDiscardable && )

Defined at line 63 of file ../../src/storage/f2fs/vmo_manager.h

VmoDiscardable & operator= (const VmoDiscardable && )

Defined at line 64 of file ../../src/storage/f2fs/vmo_manager.h

zx_status_t Unlock (pgoff_t offset)

It unlocks |vmo_| when there is no Page using it.

Defined at line 90 of file ../../src/storage/f2fs/vmo_manager.cc

zx_status_t Zero (pgoff_t start, pgoff_t len)

Defined at line 52 of file ../../src/storage/f2fs/vmo_manager.cc