#[repr(C)]pub struct vfs_file_system_ops {
pub format: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>,
pub mount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>,
pub umount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>,
pub rename: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, from_path: *const c_char, to_path: *const c_char) -> c_int>,
pub unlink: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>,
pub mkdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char, mode: mode_t) -> c_int>,
pub rmdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>,
pub stat: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut stat) -> c_int>,
pub statvfs: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut statvfs) -> c_int>,
}
Expand description
@brief Operations on mounted file systems
Similar, but not equal, to struct super_operations in Linux
Fields§
§format: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>
@brief Format the file system on the given mount point
@param[in] mountp file system to format
@return 0 on success @return <0 on error
mount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>
@brief Perform any extra processing needed after mounting a file system
If this call returns an error, the whole vfs_mount call will signal a failure.
All fields of @p mountp will be initialized by vfs_mount beforehand, @c private_data will be initialized to NULL.
@param[in] mountp file system mount being mounted
@return 0 on success @return <0 on error
umount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>
@brief Perform the necessary clean up for unmounting a file system
@param[in] mountp file system mount being unmounted
@return 0 on success @return <0 on error
rename: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, from_path: *const c_char, to_path: *const c_char) -> c_int>
@brief Rename a file
The file @p from_path will be renamed to @p to_path
@note it is not possible to rename files across different file system
@param[in] mountp file system mount to operate on @param[in] from_path absolute path to existing file @param[in] to_path absolute path to destination
@return 0 on success @return <0 on error
unlink: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>
@brief Unlink (delete) a file from the file system
@param[in] mountp file system mount to operate on @param[in] name name of the file to delete
@return 0 on success @return <0 on error
mkdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char, mode: mode_t) -> c_int>
@brief Create a directory on the file system
@param[in] mountp file system mount to operate on @param[in] name name of the directory to create @param[in] mode file creation mode bits
@return 0 on success @return <0 on error
rmdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>
@brief Remove a directory from the file system
Only empty directories may be removed.
@param[in] mountp file system mount to operate on @param[in] name name of the directory to remove
@return 0 on success @return <0 on error
stat: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut stat) -> c_int>
@brief Get file status
@param[in] mountp file system mount to operate on @param[in] path path to file being queried @param[out] buf pointer to stat struct to fill
@return 0 on success @return <0 on error
statvfs: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut statvfs) -> c_int>
@brief Get file system status
@p path is only passed for consistency against the POSIX statvfs function. @c vfs_statvfs calls this function only when it has determined that @p path belongs to this file system. @p path is a file system relative path and does not necessarily name an existing file.
@param[in] mountp file system mount to operate on @param[in] path path to a file on the file system being queried @param[out] buf pointer to statvfs struct to fill
@return 0 on success @return <0 on error
Trait Implementations§
Source§impl Clone for vfs_file_system_ops
impl Clone for vfs_file_system_ops
Source§fn clone(&self) -> vfs_file_system_ops
fn clone(&self) -> vfs_file_system_ops
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for vfs_file_system_ops
impl Debug for vfs_file_system_ops
Source§impl Default for vfs_file_system_ops
impl Default for vfs_file_system_ops
Source§fn default() -> vfs_file_system_ops
fn default() -> vfs_file_system_ops
impl Copy for vfs_file_system_ops
Auto Trait Implementations§
impl Freeze for vfs_file_system_ops
impl RefUnwindSafe for vfs_file_system_ops
impl Send for vfs_file_system_ops
impl Sync for vfs_file_system_ops
impl Unpin for vfs_file_system_ops
impl UnwindSafe for vfs_file_system_ops
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 36 bytes