disk_backend::pr

Trait PersistentReservation

Source
pub trait PersistentReservation: Sync {
    // Required methods
    fn capabilities(&self) -> ReservationCapabilities;
    fn report<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ReservationReport, DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register<'life0, 'async_trait>(
        &'life0 self,
        current_key: Option<u64>,
        new_key: u64,
        ptpl: Option<bool>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reserve<'life0, 'async_trait>(
        &'life0 self,
        key: u64,
        reservation_type: ReservationType,
    ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn release<'life0, 'async_trait>(
        &'life0 self,
        key: u64,
        reservation_type: ReservationType,
    ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 self,
        key: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn preempt<'life0, 'async_trait>(
        &'life0 self,
        current_key: u64,
        preempt_key: u64,
        reservation_type: ReservationType,
        abort: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait implemented by disks that support SCSI-style persistent reservations.

Required Methods§

Source

fn capabilities(&self) -> ReservationCapabilities

Returns the disk’s capabilities.

Source

fn report<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ReservationReport, DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a report of the current registration and reservation state.

Source

fn register<'life0, 'async_trait>( &'life0 self, current_key: Option<u64>, new_key: u64, ptpl: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates the registration for this client.

If the current key does not match old_key, then fails with DiskError::ReservationConflict. If old_key is None, then update the registration regardless.

If new_key is 0, then remove the registration.

ptpl provides an optional new state for “persist through power loss”.

Source

fn reserve<'life0, 'async_trait>( &'life0 self, key: u64, reservation_type: ReservationType, ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a reservation for this client with type reservation_type.

Fails with DiskError::ReservationConflict if there is a key mismatch.

Source

fn release<'life0, 'async_trait>( &'life0 self, key: u64, reservation_type: ReservationType, ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Releases the reservation for this client with type reservation_type.

Fails with DiskError::ReservationConflict if there is a key or type mismatch.

Source

fn clear<'life0, 'async_trait>( &'life0 self, key: u64, ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clears any reservation and registration for this client.

Fails with DiskError::ReservationConflict if there is a key mismatch.

Source

fn preempt<'life0, 'async_trait>( &'life0 self, current_key: u64, preempt_key: u64, reservation_type: ReservationType, abort: bool, ) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Preempts an existing reservation. See the SCSI spec for the precise behavior of this.

Implementors§