Records

Functions

  • BlockServer * block_server_new (const PartitionInfo * partition_info, Callbacks callbacks)

    Creates a new block server. Returns nullptr on failure (e.g. if the thread to run the block

    server failed to start).

    # Safety

    All callbacks in `callbacks` must be safe.

  • void block_server_thread (const void * arg)

    Runs the main loop to handle FIDL requests for the block server. Blocks until the server is

    shutting down.

    After this returns, the caller *must* call [`block_server_thread_release`] on the same thread.

    # Safety

    `arg` must be the value passed to the `start_thread` callback.

  • void block_server_thread_release (const void * arg)

    Called to release the thread. This *must* always be called on the thread spawned by

    [`Callbacks::start_thread`], regardless of whether [`block_server_thread`] is called or not.

    # Safety

    `arg` must be the value passed to the `start_thread` callback.

  • void block_server_delete (const BlockServer * block_server)

    # Safety

    `block_server` must be valid and either `block_server_delete` or `block_server_delete_async` may

    only be called once.

  • void block_server_delete_async (const BlockServer * block_server, ShutdownCallback callback, void * arg)

    # Safety

    `block_server` must be valid and either `block_server_delete` or `block_server_delete_async` may

    only be called once.

  • void block_server_serve (const BlockServer * block_server, zx_handle_t handle)

    Serves the Volume protocol for this server. `handle` is consumed.

    # Safety

    `block_server` and `handle` must be valid.

  • void block_server_session_run (const Session * session)

    # Safety

    `session` must be valid.

  • void block_server_session_release (const Session * session)

    # Safety

    `session` must be valid.

  • void block_server_send_reply (const BlockServer * block_server, RequestId request_id, zx_status_t status)

    # Safety

    `block_server` must be valid.