Skip to content

Commit 6cb92dc

Browse files
committed
Implementers of FileOperations need to be Send as well.
1 parent 4f0e492 commit 6cb92dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rust/kernel/file_operations.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,9 @@ impl IoctlCommand {
415415
/// You implement this trait whenever you would create a `struct file_operations`.
416416
///
417417
/// File descriptors may be used from multiple threads/processes concurrently, so your type must be
418-
/// [`Sync`].
419-
pub trait FileOperations: Sync + Sized {
418+
/// [`Sync`]. It must also be [`Send`] because [`FileOperations::release`] will be called from the
419+
/// thread that decrements that associated file's refcount to zero.
420+
pub trait FileOperations: Send + Sync + Sized {
420421
/// The methods to use to populate [`struct file_operations`].
421422
const TO_USE: ToUse;
422423

0 commit comments

Comments
 (0)