class FuchsiaVfs
Defined at line 69 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
Vfs specialization that adds Fuchsia-specific
Public Methods
void FuchsiaVfs (async_dispatcher_t * dispatcher)
Defined at line 132 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
void CloseAllConnectionsForVnode (const Vnode & node, CloseAllConnectionsForVnodeCallback callback)
Closes all connections to a Vnode and calls |callback| after all connections are closed. The
caller must ensure that no new connections or transactions are created during this point.
void FuchsiaVfs (const FuchsiaVfs & )
Not copyable or movable
Defined at line 136 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
FuchsiaVfs & operator= (const FuchsiaVfs & )
Defined at line 137 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
void ~FuchsiaVfs ()
Defined at line 137 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
bool IsTerminating ()
Identifies if the filesystem is in the process of terminating. May be checked by active
connections, which, upon reading new port packets, should ignore them and close immediately.
Defined at line 146 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
zx_status_t Unlink (fbl::RefPtr<Vnode> vn, std::string_view name, bool must_be_dir)
Vfs overrides.
Defined at line 148 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
void TokenDiscard (zx::event ios_token)
Defined at line 156 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t VnodeToToken (fbl::RefPtr<Vnode> vn, zx::event * ios_token, zx::event * out)
Defined at line 177 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t Rename (zx::event token, fbl::RefPtr<Vnode> oldparent, std::string_view oldStr, std::string_view newStr)
Defined at line 226 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
void SetDispatcher (async_dispatcher_t * dispatcher)
Defined at line 142 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
async_dispatcher_t * dispatcher ()
Defined at line 164 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
zx_status_t ServeDirectory (fbl::RefPtr<Vnode> vn, fidl::ServerEnd<fuchsia_io::Directory> server_end)
Convenience wrapper over |ServeDirectory| with maximum rights.
Defined at line 196 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
bool IsTokenAssociatedWithVnode (zx::event token)
Defined at line 205 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t Link (zx::event token, fbl::RefPtr<Vnode> oldparent, std::string_view oldStr, std::string_view newStr)
Defined at line 280 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx::result<FilesystemInfo> GetFilesystemInfo ()
Provides the implementation for fuchsia.io.Directory.QueryFilesystem().
This default implementation returns ZX_ERR_NOT_SUPPORTED.
Defined at line 276 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t ServeDeprecated (const fbl::RefPtr<Vnode> & vnode, zx::channel server_end, DeprecatedOptions options)
Begins serving VFS messages over the specified channel. The protocol to use will be determined
by the intersection of the protocols requested in |options| and those supported by |vnode|.
|server_end| usually speaks a protocol that composes |fuchsia.io/Node|, but may speak an
arbitrary arbitrary protocol for service connections.
On failure, |server_end| will be closed with an epitaph matching the returned error.
*NOTE*: |vnode| must be opened before calling this function, and will be automatically closed
on failure. This does not apply to node reference connections, which should not open |vnode|.
TODO(https://fxbug.dev/324080864): Remove this method when we no longer need to support Open1.
Defined at line 331 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t Serve (fbl::RefPtr<Vnode> vn, zx::channel channel, fuchsia_io::Flags flags)
Begins serving VFS messages over the specified channel. The protocol to use will be determined
by the intersection of the protocols requested in |flags| and those supported by |vnode|.
The connection rights will be set to the |fuchsia.io/Flags.PERM_*| bits present in |flags|.
|server_end| usually speaks a protocol that composes |fuchsia.io/Node|, but may speak an
arbitrary arbitrary protocol for service connections.
On failure, |channel| will be closed with an epitaph matching the returned status.
Defined at line 445 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t ServeDirectory (fbl::RefPtr<Vnode> vn, fidl::ServerEnd<fuchsia_io::Directory> server_end, fuchsia_io::Rights rights)
Serves a Vnode over the specified channel (used for creating new filesystems); the
Vnode must be a directory.
Defined at line 438 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
Protected Methods
void Shutdown (ShutdownCallback closure)
Unmounts the underlying filesystem. The result of shutdown is delivered via calling |closure|.
|Shutdown| may be synchronous or asynchronous. The closure may be invoked before or after
|Shutdown| returns.
zx::result<> RegisterConnection (std::unique_ptr<internal::Connection> connection, zx::channel & channel)
Starts FIDL message dispatching on |channel|, at the same time starts to manage the lifetime of
|connection|. Consumes |channel| on success. On error, callers must close the associated vnode.
void WillDestroy ()
Indicates this VFS instance is soon to be destroyed. After calling this, `WaitTillDone` can be
called to wait until there are no strong references remaining. It is not safe to call this
more than once.
Defined at line 240 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
void WaitTillDone ()
Waits till there are no strong references.
Defined at line 248 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.h
zx::result<> ServeResult (OpenResult open_result, fuchsia_io::Rights rights, zx::channel & object_request, fuchsia_io::Flags flags, const fuchsia_io::wire::Options & options)
Serve |open_result| using negotiated protocol and specified |rights|. On failure, if
|object_request| was not consumed, the caller should close it with an epitaph.
*NOTE*: |rights| and |flags| are ignored for services.
Defined at line 482 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t ServeImpl (fbl::RefPtr<Vnode> vn, zx::channel & server_end, fuchsia_io::Flags flags)
On success, starts handling requests for |vnode| over |server_end|. On failure, callers are
responsible for closing |server_end|.
Defined at line 453 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
zx_status_t ServeDeprecatedImpl (const fbl::RefPtr<Vnode> & vnode, zx::channel & server_end, DeprecatedOptions options)
On success, starts handling requests for |vnode| over |server_end|. On failure, callers are
responsible for closing |vnode| and |server_end|.
Defined at line 353 of file ../../src/storage/lib/vfs/cpp/fuchsia_vfs.cc
Records
Friends
class DirectoryConnection