#[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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.