Skip to content

Commit e63414c

Browse files
authored
Merge pull request #148 from wedsonaf/send
Implementers of `FileOperations` need to be `Send` as well.
2 parents 7ba0f81 + 6cb92dc commit e63414c

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)