Trait kernel::file_operations::FileOpenAdapter[][src]

pub trait FileOpenAdapter {
    type Arg;
    unsafe fn convert(_inode: *mut inode, _file: *mut file) -> *const Self::Arg;
}
Expand description

Trait for extracting file open arguments from kernel data structures.

This is meant to be implemented by registration managers.

Associated Types

The type of argument this adapter extracts.

Required methods

Converts untyped data stored in [struct inode] and [struct file] (when [struct file_operations::open] is called) into the given type. For example, for miscdev devices, a pointer to the registered [struct miscdev] is stored in [struct file::private_data].

Safety

This function must be called only when [struct file_operations::open] is being called for a file that was registered by the implementer.

Implementors