diff options
| author | Andreas Hindborg <a.hindborg@kernel.org> | 2025-09-02 11:55:08 +0200 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-09-02 05:23:56 -0600 |
| commit | 90d952fac8ac1aa6cb21aad7010d33af4d309f4a (patch) | |
| tree | 441a33471326489de8c645412862bc155bef6d21 /drivers/block/rnull | |
| parent | d969d504bc13b2f0c1f208e009e73f2625b421c0 (diff) | |
rust: block: add `GenDisk` private data support
Allow users of the rust block device driver API to install private data in
the `GenDisk` structure.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250902-rnull-up-v6-16-v7-14-b5212cc89b98@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/rnull')
| -rw-r--r-- | drivers/block/rnull/rnull.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/rnull/rnull.rs b/drivers/block/rnull/rnull.rs index 8690ff5f974f..8255236bc550 100644 --- a/drivers/block/rnull/rnull.rs +++ b/drivers/block/rnull/rnull.rs @@ -61,14 +61,16 @@ impl NullBlkDevice { .logical_block_size(block_size)? .physical_block_size(block_size)? .rotational(rotational) - .build(fmt!("{}", name.to_str()?), tagset) + .build(fmt!("{}", name.to_str()?), tagset, ()) } } #[vtable] impl Operations for NullBlkDevice { + type QueueData = (); + #[inline(always)] - fn queue_rq(rq: ARef<mq::Request<Self>>, _is_last: bool) -> Result { + fn queue_rq(_queue_data: (), rq: ARef<mq::Request<Self>>, _is_last: bool) -> Result { mq::Request::end_ok(rq) .map_err(|_e| kernel::error::code::EIO) // We take no refcounts on the request, so we expect to be able to @@ -79,5 +81,5 @@ impl Operations for NullBlkDevice { Ok(()) } - fn commit_rqs() {} + fn commit_rqs(_queue_data: ()) {} } |
