class OpenResult

Defined at line 179 of file ../../src/storage/lib/vfs/cpp/vfs.h

Holds a (possibly opened) Vnode, ensuring that the open count is managed correctly.

Public Methods

void OpenResult (const OpenResult & )

Cannot allow copy as this will result in the open count being incorrect.

Defined at line 182 of file ../../src/storage/lib/vfs/cpp/vfs.h

OpenResult & operator= (const OpenResult & )

Defined at line 183 of file ../../src/storage/lib/vfs/cpp/vfs.h

void OpenResult (OpenResult && )

Defined at line 184 of file ../../src/storage/lib/vfs/cpp/vfs.h

OpenResult & operator= (OpenResult && )

Defined at line 185 of file ../../src/storage/lib/vfs/cpp/vfs.h

zx::result<OpenResult> OpenVnode (fbl::RefPtr<fs::Vnode> vnode, VnodeProtocol protocol)

Handles opening |vnode| if required based on the specified |protocol|. The |vnode| will be

closed when this object is destroyed, if required, unless |TakeVnode()| is called.

Defined at line 189 of file ../../src/storage/lib/vfs/cpp/vfs.h

zx::result<OpenResult> Remote (fbl::RefPtr<fs::Vnode> vnode, std::string_view path)

Creates a new |OpenResult| from a remote |vnode|. This object keeps an unowned copy of |path|,

so the underlying string must outlive this object.

Defined at line 206 of file ../../src/storage/lib/vfs/cpp/vfs.h

zx::result<OpenResult> Local (fbl::RefPtr<fs::Vnode> vnode, VnodeProtocol protocol)

Creates a new |OpenResult| from a local node. |vnode| is assumed to already have been opened,

and unless |TakeVnode()| is called, will be closed when this object is destroyed.

Defined at line 213 of file ../../src/storage/lib/vfs/cpp/vfs.h

void ~OpenResult ()

Ensure we roll back the vnode open count when required. There are only two cases where we do

not open a vnode: 1) remote nodes, and 2) node-reference connections

Defined at line 220 of file ../../src/storage/lib/vfs/cpp/vfs.h

fbl::RefPtr<fs::Vnode> TakeVnode ()

Take the vnode out of this object. The caller is responsible for closing the node if required.

Defined at line 227 of file ../../src/storage/lib/vfs/cpp/vfs.h

const fbl::RefPtr<fs::Vnode> & vnode ()

Defined at line 228 of file ../../src/storage/lib/vfs/cpp/vfs.h

fs::VnodeProtocol protocol ()

The protocol which was negotiated for this node if we resolved it locally. The vnode must not

be a remote, as the remote server is responsible for performing protocol negotiation.

Defined at line 232 of file ../../src/storage/lib/vfs/cpp/vfs.h

std::string_view path ()

Remainder of the path to forward if this is a remote node.

Defined at line 238 of file ../../src/storage/lib/vfs/cpp/vfs.h