`GenDisk` is a pointer to a `struct gendisk`. It is safe to reference this struct from multiple threads. Signed-off-by: Andreas Hindborg --- rust/kernel/block/mq/gen_disk.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs index 75968d6a57639..72bbf3cadfe82 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -218,6 +218,10 @@ pub struct GenDisk { // `TagSet` It is safe to send this to other threads as long as T is Send. unsafe impl Send for GenDisk {} +// SAFETY: `GenDisk` is an owned pointer to a `struct gendisk` and an `Arc` to a `TagSet`. It is +// safe to reference these from multiple threads. +unsafe impl Sync for GenDisk {} + impl Drop for GenDisk { fn drop(&mut self) { // SAFETY: By type invariant of `Self`, `self.gendisk` points to a valid -- 2.51.2