From 6cb92dc4197357c95891243eab0ce293cd88d8fc Mon Sep 17 00:00:00 2001 From: Wedson Almeida Filho Date: Mon, 29 Mar 2021 12:28:56 +0100 Subject: [PATCH] Implementers of `FileOperations` need to be `Send` as well. --- rust/kernel/file_operations.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/kernel/file_operations.rs b/rust/kernel/file_operations.rs index 24d6f9ed0a41f4..2784298f71b0ea 100644 --- a/rust/kernel/file_operations.rs +++ b/rust/kernel/file_operations.rs @@ -415,8 +415,9 @@ impl IoctlCommand { /// You implement this trait whenever you would create a `struct file_operations`. /// /// File descriptors may be used from multiple threads/processes concurrently, so your type must be -/// [`Sync`]. -pub trait FileOperations: Sync + Sized { +/// [`Sync`]. It must also be [`Send`] because [`FileOperations::release`] will be called from the +/// thread that decrements that associated file's refcount to zero. +pub trait FileOperations: Send + Sync + Sized { /// The methods to use to populate [`struct file_operations`]. const TO_USE: ToUse;