Lines Matching full:file

16     fs::File,
114 /// The returned pointer will be stored as the private data for the file.
115 fn open(_file: &File, _misc: &MiscDeviceRegistration<Self>) -> Result<Self::Ptr>; in open() argument
118 fn release(device: Self::Ptr, _file: &File) { in release() argument
129 _file: &File, in ioctl() argument
146 _file: &File, in compat_ioctl() argument
157 _file: &File, in show_fdinfo() argument
199 /// `file` and `inode` must be the file and inode for a file that is undergoing initialization.
200 /// The file must be associated with a `MiscDeviceRegistration<T>`.
203 raw_file: *mut bindings::file, in fops_open() argument
205 // SAFETY: The pointers are valid and for a file being opened. in fops_open()
211 // SAFETY: The open call of a file can access the private data. in fops_open()
220 // * This underlying file is valid for (much longer than) the duration of `T::open`. in fops_open()
221 // * There is no active fdget_pos region on the file on this thread. in fops_open()
222 let file = unsafe { File::from_raw_file(raw_file) }; in fops_open() localVariable
224 let ptr = match T::open(file, misc) { in fops_open()
230 // this file's private data. All future accesses to the private data is performed by other in fops_open()
231 // fops_* methods in this file, which all correctly cast the private data to the new type. in fops_open()
233 // SAFETY: The open call of a file can access the private data. in fops_open()
241 /// `file` and `inode` must be the file and inode for a file that is being released. The file must
245 file: *mut bindings::file, in fops_release() argument
247 // SAFETY: The release call of a file owns the private data. in fops_release()
248 let private = unsafe { (*file).private_data }; in fops_release()
249 // SAFETY: The release call of a file owns the private data. in fops_release()
253 // * The file is valid for the duration of this call. in fops_release()
254 // * There is no active fdget_pos region on the file on this thread. in fops_release()
255 T::release(ptr, unsafe { File::from_raw_file(file) }); in fops_release()
262 /// `file` must be a valid file that is associated with a `MiscDeviceRegistration<T>`.
264 file: *mut bindings::file, in fops_ioctl() argument
268 // SAFETY: The ioctl call of a file can access the private data. in fops_ioctl()
269 let private = unsafe { (*file).private_data }; in fops_ioctl()
270 // SAFETY: Ioctl calls can borrow the private data of the file. in fops_ioctl()
274 // * The file is valid for the duration of this call. in fops_ioctl()
275 // * There is no active fdget_pos region on the file on this thread. in fops_ioctl()
276 let file = unsafe { File::from_raw_file(file) }; in fops_ioctl() localVariable
278 match T::ioctl(device, file, cmd, arg) { in fops_ioctl()
286 /// `file` must be a valid file that is associated with a `MiscDeviceRegistration<T>`.
289 file: *mut bindings::file, in fops_compat_ioctl() argument
293 // SAFETY: The compat ioctl call of a file can access the private data. in fops_compat_ioctl()
294 let private = unsafe { (*file).private_data }; in fops_compat_ioctl()
295 // SAFETY: Ioctl calls can borrow the private data of the file. in fops_compat_ioctl()
299 // * The file is valid for the duration of this call. in fops_compat_ioctl()
300 // * There is no active fdget_pos region on the file on this thread. in fops_compat_ioctl()
301 let file = unsafe { File::from_raw_file(file) }; in fops_compat_ioctl() localVariable
303 match T::compat_ioctl(device, file, cmd, arg) { in fops_compat_ioctl()
311 /// - `file` must be a valid file that is associated with a `MiscDeviceRegistration<T>`.
315 file: *mut bindings::file, in fops_show_fdinfo() argument
317 // SAFETY: The release call of a file owns the private data. in fops_show_fdinfo()
318 let private = unsafe { (*file).private_data }; in fops_show_fdinfo()
319 // SAFETY: Ioctl calls can borrow the private data of the file. in fops_show_fdinfo()
322 // * The file is valid for the duration of this call. in fops_show_fdinfo()
323 // * There is no active fdget_pos region on the file on this thread. in fops_show_fdinfo()
324 let file = unsafe { File::from_raw_file(file) }; in fops_show_fdinfo() localVariable
329 T::show_fdinfo(device, m, file); in fops_show_fdinfo()