Trait kernel::block::mq::Operations
source · pub trait Operations: Sized {
type QueueData: ForeignOwnable;
const USE_VTABLE_ATTR: ();
const HAS_QUEUE_RQ: bool = false;
const HAS_COMMIT_RQS: bool = false;
const HAS_COMPLETE: bool = false;
const HAS_POLL: bool = false;
// Required methods
fn queue_rq(
queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>,
rq: ARef<Request<Self>>,
is_last: bool
) -> Result;
fn commit_rqs(queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>);
fn complete(rq: ARef<Request<Self>>);
// Provided method
fn poll() -> bool { ... }
}Expand description
Implement this trait to interface blk-mq as block devices.
To implement a block device driver, implement this trait as described in the
module level documentation. The kernel will use the implementation of the
functions defined in this trait to interface a block device driver. Note:
There is no need for an exit_request() implementation, because the drop
implementation of the Request type will be invoked by automatically by
the C/Rust glue logic.
Required Associated Types§
sourcetype QueueData: ForeignOwnable
type QueueData: ForeignOwnable
Data associated with the struct request_queue that is allocated for
the GenDisk associated with this Operations implementation.
Required Associated Constants§
sourceconst USE_VTABLE_ATTR: ()
const USE_VTABLE_ATTR: ()
A marker to prevent implementors from forgetting to use #[vtable]
attribute when implementing this trait.
Provided Associated Constants§
sourceconst HAS_QUEUE_RQ: bool = false
const HAS_QUEUE_RQ: bool = false
Indicates if the queue_rq method is overridden by the implementor.
sourceconst HAS_COMMIT_RQS: bool = false
const HAS_COMMIT_RQS: bool = false
Indicates if the commit_rqs method is overridden by the implementor.
sourceconst HAS_COMPLETE: bool = false
const HAS_COMPLETE: bool = false
Indicates if the complete method is overridden by the implementor.
Required Methods§
sourcefn queue_rq(
queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>,
rq: ARef<Request<Self>>,
is_last: bool
) -> Result
fn queue_rq( queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>, rq: ARef<Request<Self>>, is_last: bool ) -> Result
Called by the kernel to queue a request with the driver. If is_last is
false, the driver is allowed to defer committing the request.
sourcefn commit_rqs(queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>)
fn commit_rqs(queue_data: <Self::QueueData as ForeignOwnable>::Borrowed<'_>)
Called by the kernel to indicate that queued requests should be submitted.