Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: block: add block related constants

Add a few block subsystem constants to the rust `kernel::block` name space.
This makes it easier to access the constants from rust code.

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-11-b5212cc89b98@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Andreas Hindborg and committed by
Jens Axboe
19c37c91 8c32697c

+13
+13
rust/kernel/block.rs
··· 3 3 //! Types for working with the block layer. 4 4 5 5 pub mod mq; 6 + 7 + /// Bit mask for masking out [`SECTOR_SIZE`]. 8 + pub const SECTOR_MASK: u32 = bindings::SECTOR_MASK; 9 + 10 + /// Sectors are size `1 << SECTOR_SHIFT`. 11 + pub const SECTOR_SHIFT: u32 = bindings::SECTOR_SHIFT; 12 + 13 + /// Size of a sector. 14 + pub const SECTOR_SIZE: u32 = bindings::SECTOR_SIZE; 15 + 16 + /// The difference between the size of a page and the size of a sector, 17 + /// expressed as a power of two. 18 + pub const PAGE_SECTORS_SHIFT: u32 = bindings::PAGE_SECTORS_SHIFT;