Struct p9::Server

source ·
pub struct Server {
    fids: BTreeMap<u32, Fid>,
    proc: File,
    cfg: Config,
}

Fields§

§fids: BTreeMap<u32, Fid>§proc: File§cfg: Config

Implementations§

Implement posix byte range locking code. Our implementation mirrors that of QEMU/9p - that is to say, we essentially punt on mirroring lock state between client/server and defer lock semantics to the VFS layer on the client side. Aside from fd existence check we always return success. QEMU reference: https://github.com/qemu/qemu/blob/754f756cc4c6d9d14b7230c62b5bb20f9d655888/hw/9pfs/9p.c#L3669

NOTE: this means that files locked on the client may be interefered with from either the server’s side, or from other clients (guests). This tracks with QEMU implementation, and will be obviated if crosvm decides to drop 9p in favor of virtio-fs. QEMU only allows for a single client, and we leave it to users of the crate to provide actual lock handling.

Much like lock(), defer locking semantics to VFS and return success.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.